[CMake] Proper way to build static binaries

Florian Reinhard florian.reinhard at googlemail.com
Fri Sep 16 03:02:14 EDT 2011


Hi!

For GNU/MinGW gcc i do use this:

# MinGW / GNU Compiler
IF( ${CMAKE_COMPILER_IS_GNUCXX} )
 # link libstdc++ and others statically
 SET (CMAKE_EXE_LINKER_FLAGS    "-static-libstdc++ -static-libgcc
--disable-shared --enable-static --static")
ENDIF( ${CMAKE_COMPILER_IS_GNUCXX} )

Regards,

Florian


More information about the CMake mailing list