[CMake] CMAKE_<LANG>_FLAGS also used for linking?

Rolf Eike Beer eike at sf-mail.de
Fri Dec 23 14:12:07 EST 2011


Sean McBride wrote:
> Hi all,
> 
> Searching the archives, I see that CMake deliberately passes the
> CMAKE_<LANG>_FLAGS for linking too:
> 
> <http://www.cmake.org/pipermail/cmake/2010-July/038090.html>
> 
> If I add -std=c++0x to CMAKE_CXX_FLAGS, then compilation is fine, but clang
> will warn when linking:
> 
> clang-3: warning: argument unused during compilation: '-std=c++0x'
> 
> How does one specify flags only for compilation, not linking?

Try SET_SOURCE_FILES_PROPERTIES(${MYCPPS} PROPERTIES COMPILE_FLAGS --
std=c++0x)

Eike
-- 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://www.cmake.org/pipermail/cmake/attachments/20111223/78c24125/attachment.pgp>


More information about the CMake mailing list