There's no way to test whether a given *linker* flag works
This issue was created automatically from an original Mantis Issue. Further discussion may take place here.
There are macros to test whether a given compiler flag works, such as CHECK_C_COMPILER_FLAG
and CHECK_CXX_COMPILER_FLAG
.
There is no macro to test whether a given linker flag works.
Furthermore, there does not appear to be a way to do a CHECK_C_SOURCE_RUNS
with a given linker flag, so there does not appear to be a way to write a macro to test whether a given linker flag works. Setting CMAKE_REQUIRED_FLAGS
does not affect what flags are used with, for example, the Xcode generator; it works with the Unix makefile generator, but that's not sufficient to support multiple build systems.