[CMake] Alternative to `add_compile_options` in Toolchain Files

Jayesh Badwaik badwaik.jayesh at gmail.com
Tue Mar 26 22:09:14 EDT 2019


Hi,

In https://gitlab.kitware.com/cmake/cmake/issues/19074, it was mentioned that 
instead of `add_compile_options`, `CMAKE_CXX_FLAGS_INIT` should be used. An 
issue with this is that `CMAKE_CXX_FLAGS_INIT` flags are propogated to the 
linker as well, wherein, the linker warns about `[-Wunused-command-line-
argument]` if those warnings are enabled. 

Is there an alternative to `CMAKE_CXX_FLAGS_INIT` which avoids these issues? 

Thanks

-- 
Best
Jayesh Badwaik
https://jayeshbadwaik.github.io

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part.
URL: <https://cmake.org/pipermail/cmake/attachments/20190327/e8288fb1/attachment.sig>


More information about the CMake mailing list