[cmake-developers] COMPILE_OPTIONS or COMPILE_FLAGS
Harry Mallon
Harry.Mallon at codex.online
Tue May 1 09:40:49 EDT 2018
Thanks Brad,
I think I can use FLAGS for now then, but if my requirements get more complicated I'll use OPTIONS and require 3.11. I think the docs change would be helpful.
Cheers,
Harry
Harry Mallon
CODEX | Senior Software Engineer
60 Poland Street | London | England | W1F 7NT
E harry.mallon at codex.online | T +44 203 7000 989
On 01/05/2018, 14:13, "Brad King" <brad.king at kitware.com> wrote:
On 05/01/2018 06:33 AM, Harry Mallon wrote:
> I just noticed that COMPILE_OPTIONS is 3.11.0 only. I can’t understand
> from the docs which of COMPILE_OPTIONS or COMPILE_FLAGS is preferred
> and why I might use one or the other.
COMPILE_OPTIONS for targets has existed for a long time. What is
new in 3.11 is COMPILE_OPTIONS for source files. COMPILE_FLAGS
has existed for source files for a long time too.
The difference is that COMPILE_FLAGS takes a command-line string
of flags that requires manual escaping. COMPILE_OPTIONS takes a
;-list of flags and will do the escaping automatically.
The docs of the two options should be updated to mention each other
and make the distinction clear.
-Brad
More information about the cmake-developers
mailing list