@ -430,8 +430,18 @@ else()
set ( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${RELEASE_FLAGS}" )
set ( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${RELEASE_FLAGS}" )
if ( STATIC AND NOT APPLE AND NOT FREEBSD AND NOT OPENBSD )
set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++" )
if ( STATIC )
# S T A T I C a l r e a d y c o n f i g u r e s m o s t d e p s t o b e l i n k e d i n s t a t i c a l l y ,
# h e r e w e m a k e m o r e d e p s s t a t i c i f t h e p l a t f o r m p e r m i t s i t
if ( MINGW )
# O n W i n d o w s , t h i s i s a s c l o s e t o f u l l y - s t a t i c a s w e g e t :
# t h i s l e a v e s o n l y d e p s o n / c / W i n d o w s / s y s t e m 3 2 / * . d l l
set ( STATIC_FLAGS "-static" )
elseif ( NOT ( APPLE OR FREEBSD OR OPENBSD ) )
# O n L i n u x , w e d o n ' t s u p p o r t f u l l y s t a t i c b u i l d , b u t t h e s e c a n b e s t a t i c
set ( STATIC_FLAGS "-static-libgcc -static-libstdc++" )
endif ( )
set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${STATIC_FLAGS} " )
endif ( )
endif ( )