[CMake] Setting global link flags

Brad King brad.king at kitware.com
Wed Oct 11 09:24:08 EDT 2006


Axel Roebel wrote:
> I frequently struggle with the problem to set
> global linker flags. Global here means these flags should be used 
> whenever the linker is used. The main example where I need that
> is the -mno-cygwin flag of the cygwin compiler. 
> This flag creates objects that will not make use of the cygwin dll.
> It has to be present during compilation and linking.
> 
> So for compilation I use
> 
> ADD_DEFINITION(-mno-cygwin)
> 
> for the linker there seems nothing equivalent

CMAKE_EXE_LINKER_FLAGS
CMAKE_SHARED_LINKER_FLAGS
CMAKE_MODULE_LINKER_FLAGS

-Brad



More information about the CMake mailing list