@ -295,7 +295,7 @@ link_directories(${LIBUNWIND_LIBRARY_DIRS})
if ( MSVC )
if ( MSVC )
add_definitions ( "/bigobj /MP /W3 /GS- /D_CRT_SECURE_NO_WARNINGS /wd4996 /wd4345 /D_WIN32_WINNT=0x0600 /DWIN32_LEAN_AND_MEAN /DGTEST_HAS_TR1_TUPLE=0 /FIinline_c.h /D__SSE4_1__" )
add_definitions ( "/bigobj /MP /W3 /GS- /D_CRT_SECURE_NO_WARNINGS /wd4996 /wd4345 /D_WIN32_WINNT=0x0600 /DWIN32_LEAN_AND_MEAN /DGTEST_HAS_TR1_TUPLE=0 /FIinline_c.h /D__SSE4_1__" )
# set ( COMMON_C_FLAGS "${COMMON_C_FLAGS} /Dinline=__inline" )
# set ( COMMON_C_FLAGS "${COMMON_C_FLAGS} /Dinline=__inline" )
set ( C MAKE_EXE_LINKER_FLAGS "${CMAKE _EXE_LINKER_FLAGS} /STACK:10485760")
set ( C OMMON_EXE_LINKER_FLAGS "${COMMON _EXE_LINKER_FLAGS} /STACK:10485760")
if ( STATIC )
if ( STATIC )
foreach ( VAR CMAKE_C_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE )
foreach ( VAR CMAKE_C_FLAGS_DEBUG CMAKE_CXX_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE )
string ( REPLACE "/MD" "/MT" ${ VAR } "${${VAR}}" )
string ( REPLACE "/MD" "/MT" ${ VAR } "${${VAR}}" )
@ -333,7 +333,7 @@ else()
include_directories ( SYSTEM src/platform/mingw )
include_directories ( SYSTEM src/platform/mingw )
# m i n g w d o e s n ' t s u p p o r t LTO ( multiple definition errors at link time )
# m i n g w d o e s n ' t s u p p o r t LTO ( multiple definition errors at link time )
set ( USE_LTO_DEFAULT false )
set ( USE_LTO_DEFAULT false )
set ( C MAKE_EXE_LINKER_FLAGS "${CMAKE _EXE_LINKER_FLAGS} -Wl,--stack,10485760")
set ( C OMMON_EXE_LINKER_FLAGS "${COMMON _EXE_LINKER_FLAGS} -Wl,--stack,10485760")
if ( NOT BUILD_64 )
if ( NOT BUILD_64 )
add_definitions ( -DWINVER=0x0501 -D_WIN32_WINNT=0x0501 )
add_definitions ( -DWINVER=0x0501 -D_WIN32_WINNT=0x0501 )
endif ( )
endif ( )
@ -420,9 +420,11 @@ else()
set ( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DEBUG_FLAGS}" )
set ( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DEBUG_FLAGS}" )
set ( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${RELEASE_FLAGS}" )
set ( CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${RELEASE_FLAGS}" )
set ( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_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 )
if ( STATIC AND NOT APPLE AND NOT FREEBSD AND NOT OPENBSD )
set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++" )
set ( COMMON_EXE_LINKER_FLAGS "${COMMON_EXE_LINKER_FLAGS} -static-libgcc -static-libstdc++" )
set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--wrap=__cxa_throw" )
# I n s t a l l h o o k o n t h r o w f o r d u m p i n g s t a c k o n exception ( implemented in libcommon )
set ( WRAP_CXA_THROW_FLAG "-Wl,--wrap=__cxa_throw" )
endif ( )
endif ( )
endif ( )
endif ( )
@ -471,9 +473,12 @@ endif()
include ( version.cmake )
include ( version.cmake )
# W h e n b u i l d i n g t h e f o l l o w i n g s o u r c e s , t r e a t w a r n i n g s a s e r r o r s
# W h e n b u i l d i n g t h e f o l l o w i n g s o u r c e s . . .
# . . . t r e a t w a r n i n g s a s e r r o r s , i n s t a l l t h r o w w r a p p e r
set ( CMAKE_C_FLAGS "${COMMON_C_FLAGS} ${WARNINGS_AS_ERRORS_FLAG}" )
set ( CMAKE_C_FLAGS "${COMMON_C_FLAGS} ${WARNINGS_AS_ERRORS_FLAG}" )
set ( CMAKE_CXX_FLAGS "${COMMON_CXX_FLAGS} ${WARNINGS_AS_ERRORS_FLAG}" )
set ( CMAKE_CXX_FLAGS "${COMMON_CXX_FLAGS} ${WARNINGS_AS_ERRORS_FLAG}" )
# . . . i n s t a l l h o o k o n t h r o w
set ( CMAKE_EXE_LINKER_FLAGS "${COMMON_EXE_LINKER_FLAGS} ${WRAP_CXA_THROW_FLAG}" )
add_subdirectory ( contrib )
add_subdirectory ( contrib )
add_subdirectory ( src )
add_subdirectory ( src )
@ -482,9 +487,12 @@ add_subdirectory(src)
option ( BUILD_TESTS "Build tests." OFF )
option ( BUILD_TESTS "Build tests." OFF )
if ( BUILD_TESTS )
if ( BUILD_TESTS )
# W h e n b u i l d i n g t e s t s , d o * n o t * t r e a t w a r n i n g s a s e r r o r s
# W h e n b u i l d i n g t e s t s . . .
# . . . d o * n o t * t r e a t w a r n i n g s a s e r r o r s
set ( CMAKE_C_FLAGS "${COMMON_C_FLAGS}" )
set ( CMAKE_C_FLAGS "${COMMON_C_FLAGS}" )
set ( CMAKE_CXX_FLAGS "${COMMON_CXX_FLAGS}" )
set ( CMAKE_CXX_FLAGS "${COMMON_CXX_FLAGS}" )
# . . . d o * n o t * i n s t a l l h o o k o n t h r o w
set ( CMAKE_EXE_LINKER_FLAGS "${COMMON_CXX_FLAGS}" )
add_subdirectory ( tests )
add_subdirectory ( tests )
endif ( )
endif ( )