[CMake] Best way to append "--no-undefined" to shared link flags?

Robert Dailey rcdailey.lists at gmail.com
Tue Jul 18 16:38:31 EDT 2017


For only compilers that support it (I guess any clang/gcc compiler?),
I want my shared libs to link with "--no-undefined". What is the best
(most modern) way using CMake 3.9.0 and forward to do this? Is it
still to explicitly set CMAKE_SHARED_LINKER_FLAGS? How does this
impact using toolchain files and cross compiling? I don't want to wipe
out any existing flags, and I'm not sure of the exact syntax the
command line options need to follow.


More information about the CMake mailing list