@ -7,19 +7,16 @@ set_property(DIRECTORY APPEND PROPERTY
# S e t c o m p i l a t i o n f l a g s
# S e t c o m p i l a t i o n f l a g s
if ( MSVC )
if ( MSVC )
# S i l e n c e " d e p r e c a t i o n " w a r n i n g s
add_definitions ( /D_CRT_SECURE_NO_WARNINGS /D_CRT_NONSTDC_NO_DEPRECATE /D_SCL_SECURE_NO_WARNINGS )
# A v o i d w i n d o w s . h j u n k
add_definitions ( /DNOMINMAX )
# A v o i d w i n d o w s . h f r o m i n c l u d i n g s o m e u s u a l l y u n u s e d l i b s l i k e w i n s o c k s . h , s i n c e t h i s m i g h t c a u s e s o m e r e d e f i n i t i o n e r r o r s .
add_definitions ( /DWIN32_LEAN_AND_MEAN )
set ( CMAKE_CONFIGURATION_TYPES Debug Release CACHE STRING "" FORCE )
set ( CMAKE_CONFIGURATION_TYPES Debug Release CACHE STRING "" FORCE )
# T w e a k o p t i m i z a t i o n s e t t i n g s
# S i l e n c e " d e p r e c a t i o n " w a r n i n g s
# A s f a r a s I c a n t e l l , t h e r e ' s n o w a y t o o v e r r i d e t h e C M a k e d e f a u l t s w h i l e l e a v i n g u s e r
add_definitions ( -D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS )
# c h a n g e s i n t a c t , s o w e ' l l j u s t c l o b b e r e v e r y t h i n g a n d s a y s o r r y .
message ( STATUS "Cache compiler flags ignored, please edit CMakeLists.txt to change the flags." )
# A v o i d w i n d o w s . h j u n k
add_definitions ( -DNOMINMAX )
# A v o i d w i n d o w s . h f r o m i n c l u d i n g s o m e u s u a l l y u n u s e d l i b s l i k e w i n s o c k s . h , s i n c e t h i s m i g h t c a u s e s o m e r e d e f i n i t i o n e r r o r s .
add_definitions ( -DWIN32_LEAN_AND_MEAN )
# / W 3 - L e v e l 3 w a r n i n g s
# / W 3 - L e v e l 3 w a r n i n g s
# / M P - M u l t i - t h r e a d e d c o m p i l a t i o n
# / M P - M u l t i - t h r e a d e d c o m p i l a t i o n
@ -29,22 +26,18 @@ if (MSVC)
# / E H s c - C + + - o n l y e x c e p t i o n h a n d l i n g s e m a n t i c s
# / E H s c - C + + - o n l y e x c e p t i o n h a n d l i n g s e m a n t i c s
# / Z c : t h r o w i n g N e w - l e t c o d e g e n a s s u m e ` o p e r a t o r n e w ` w i l l n e v e r r e t u r n n u l l
# / Z c : t h r o w i n g N e w - l e t c o d e g e n a s s u m e ` o p e r a t o r n e w ` w i l l n e v e r r e t u r n n u l l
# / Z c : i n l i n e - l e t c o d e g e n o m i t i n l i n e f u n c t i o n s i n o b j e c t f i l e s
# / Z c : i n l i n e - l e t c o d e g e n o m i t i n l i n e f u n c t i o n s i n o b j e c t f i l e s
set( CMAKE_CXX_FLAGS "/W3 /MP /Zi /Zo /permissive- /EHsc /std:c++latest /Zc:throwingNew,inline" CACHE STRING "" FORCE )
add_compile_options( /W3 /MP /Zi /Zo /permissive- /EHsc /std:c++latest /Zc:throwingNew,inline )
# / O 2 - O p t i m i z a t i o n l e v e l 2
# / G S - - N o s t a c k b u f f e r o v e r f l o w c h e c k s
# / G S - - N o s t a c k b u f f e r o v e r f l o w c h e c k s
# / M D - M u l t i - t h r e a d e d r u n t i m e D L L
add_compile_options ( "$<$<CONFIG:Release>:/GS->" )
set ( CMAKE_C_FLAGS_RELEASE "/O2 /GS- /MD" CACHE STRING "" FORCE )
set ( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}" CACHE STRING "" FORCE )
set ( CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG /MANIFEST:NO" CACHE STRING "" FORCE )
set ( CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG /MANIFEST:NO" CACHE STRING "" FORCE )
set ( CMAKE_EXE_LINKER_FLAGS_RELEASE "/DEBUG /MANIFEST:NO /INCREMENTAL:NO /OPT:REF,ICF" CACHE STRING "" FORCE )
set ( CMAKE_EXE_LINKER_FLAGS_RELEASE "/DEBUG /MANIFEST:NO /INCREMENTAL:NO /OPT:REF,ICF" CACHE STRING "" FORCE )
else ( )
else ( )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes")
add_compile_options( " -Wno-attributes")
if ( APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL Clang )
if ( APPLE AND CMAKE_CXX_COMPILER_ID STREQUAL Clang )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" )
add_compile_options ( "-stdlib=libc++" )
set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++" )
endif ( )
endif ( )
# S e t f i l e o f f s e t s i z e t o 6 4 b i t s .
# S e t f i l e o f f s e t s i z e t o 6 4 b i t s .
@ -61,8 +54,7 @@ else()
if ( MINGW_STATIC_BUILD )
if ( MINGW_STATIC_BUILD )
add_definitions ( -DQT_STATICPLUGIN )
add_definitions ( -DQT_STATICPLUGIN )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static" )
add_compile_options ( "-static" )
set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static" )
endif ( )
endif ( )
endif ( )
endif ( )
endif ( )
endif ( )