I have a project with both GCC and Clang used. I need to pass an option to
the linker. I tried to used CMake this way:

SET_TARGET_PROPERTIES(mytarget PROPERTIES LINK_FLAGS
"--allow-shlib-undefined")

However this simply adds the option *--allow-shlib-undefined* to the
compiler options. But GCC and Clang expects different prefixes for passing
an option to the linker. For example, GCC expects it to be
-Wl--allow-shlib-undefined, while Clang expects another prefix.

Is it possible to solve this in a compiler independent way? Or do I have to
add the prefix myself with and if-else block?



--
View this message in context: 
http://cmake.3232098.n2.nabble.com/Passing-linker-argument-in-a-compiler-independent-way-in-CMake-tp7582239.html
Sent from the CMake mailing list archive at Nabble.com.
--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to