[LLVMdev] cmake/ninja build failing
Alexey Samsonov
samsonov at google.com
Thu Feb 13 07:55:53 PST 2014
Brad,
How does COMPILE_FLAGS and COMPILE_OPTIONS work together? I.e. are their
contents joined to produce a single compiler invocation?
Also, why there is no COMPILE_OPTIONS property for source files?
Looks like we really need to switch to newer CMake and make use of
target_compile_options...
On Thu, Feb 13, 2014 at 6:08 PM, Brad King <brad.king at kitware.com> wrote:
> On 2/12/2014 11:15 PM, Seth Cantrell wrote:
> > Well, I updated to cmake 2.8.12.2 but the result of changing that
> > COMPILE_FLAGS to COMPILE_OPTIONS is that quotes are applied incorrectly
>
> That's because the set_target_compile_flags function in LLVM is
> creating the space-separated command-line string that the old
> COMPILE_FLAGS option wants:
>
> >> function(set_target_compile_flags target)
> >> foreach(arg ${ARGN})
> >> set(argstring "${argstring} ${arg}")
> >> endforeach()
> >> set_property(TARGET ${target} PROPERTY COMPILE_FLAGS "${argstring}")
> >> endfunction()
>
> Try changing the function to just:
>
> function(set_target_compile_flags target)
> set_property(TARGET ${target} PROPERTY COMPILE_OPTIONS "${ARGN}")
> endfunction()
>
> Of course an upstream version of this change would be simpler
> if it just dropped set_target_compile_flags and set the property
> directly at the call sites. One could even use the APPEND option
> of set_property to add options incrementally.
>
> -Brad
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>
--
Alexey Samsonov, MSK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20140213/5a8bdbee/attachment.html>
More information about the llvm-dev
mailing list