[LLVMdev] cmake/ninja build failing

Brad King brad.king at kitware.com
Thu Feb 13 10:58:04 PST 2014


On 2/13/2014 10:55 AM, Alexey Samsonov wrote:
> How does COMPILE_FLAGS and COMPILE_OPTIONS work together? I.e. are their
> contents joined to produce a single compiler invocation?

Both are used but the order is not defined.  Of course the
preference is to set COMPILE_OPTIONS only and drop any use
of COMPILE_FLAGS.

> Also, why there is no COMPILE_OPTIONS property for source files?

AFAIK there is no reason besides the author of the feature
not including it in the implementation.  The change was made
as part of a sweeping "usage requirements" feature which
makes sense at the target level but not per-source.  There
is also an INTERFACE_COMPILE_OPTIONS property which can also
be managed by the target_compile_options command and specifies
options needed to compile objects in consumers of a library
before linking it.

There is a per-source COMPILE_DEFINITIONS for macros and
still the old per-source COMPILE_FLAGS as a last resort.

-Brad



More information about the llvm-dev mailing list