@ -102,7 +102,7 @@ endif()
message ( STATUS "Target architecture: ${ARCHITECTURE}" )
message ( STATUS "Target architecture: ${ARCHITECTURE}" )
# C o n f i g u r e co m p i l a t i o n f l a g s
# C o n f i g u r e C+ + s t a n d a r d
# = = = = = = = = = = = = = = = = = = = = = = = = = = =
# = = = = = = = = = = = = = = = = = = = = = = = = = = =
set ( CMAKE_CXX_STANDARD 17 )
set ( CMAKE_CXX_STANDARD 17 )
@ -112,75 +112,6 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ PROJECT_BINARY_DIR } /bin )
set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ PROJECT_BINARY_DIR } /bin )
if ( NOT MSVC )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-attributes" )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS}" )
if ( MINGW )
add_definitions ( -DMINGW_HAS_SECURE_API )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -gdwarf" )
if ( MINGW_STATIC_BUILD )
add_definitions ( -DQT_STATICPLUGIN )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static" )
set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static" )
endif ( )
endif ( )
else ( )
# 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 )
# 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
# 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
# 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." )
# / 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
# / Z i - O u t p u t d e b u g g i n g i n f o r m a t i o n
# / Z o - e n h a n c e d d e b u g i n f o f o r o p t i m i z e d b u i l d s
# / p e r m i s s i v e - - e n a b l e s s t r i c t e r C + + s t a n d a r d s c o n f o r m a n c e c h e c k s
set ( CMAKE_C_FLAGS "/W3 /MP /Zi /Zo /permissive-" CACHE STRING "" FORCE )
# / 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
# / s t d : c + + l a t e s t - L a t e s t a v a i l a b l e C + + s t a n d a r d
# / 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
set ( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} /EHsc /std:c++latest /Zc:throwingNew,inline" CACHE STRING "" FORCE )
# / M D d - M u l t i - t h r e a d e d D e b u g R u n t i m e D L L
set ( CMAKE_C_FLAGS_DEBUG "/Od /MDd" CACHE STRING "" FORCE )
set ( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}" CACHE STRING "" FORCE )
# / 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
# / 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
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_RELEASE "/DEBUG /MANIFEST:NO /INCREMENTAL:NO /OPT:REF,ICF" CACHE STRING "" FORCE )
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 .
#
# O n m o d e r n U n i x e s , t h i s i s t y p i c a l l y a l r e a d y t h e c a s e . T h e l o n e e x c e p t i o n i s
# g l i b c , w h i c h m a y d e f a u l t t o 3 2 b i t s . g l i b c a l l o w s t h i s t o b e c o n f i g u r e d
# b y s e t t i n g _ F I L E _ O F F S E T _ B I T S .
if ( CMAKE_SYSTEM_NAME STREQUAL "Linux" OR MINGW )
add_definitions ( -D_FILE_OFFSET_BITS=64 )
endif ( )
add_definitions ( -DSINGLETHREADED )
# C M a k e s e e m s t o o n l y d e f i n e _ D E B U G o n W i n d o w s
set_property ( DIRECTORY APPEND PROPERTY
C O M P I L E _ D E F I N I T I O N S $ < $ < C O N F I G : D e b u g > : _ D E B U G > $ < $ < N O T : $ < C O N F I G : D e b u g > > : N D E B U G > )
# S y s t e m i m p o r t e d l i b r a r i e s
# S y s t e m i m p o r t e d l i b r a r i e s
# = = = = = = = = = = = = = = = = = = = = = =
# = = = = = = = = = = = = = = = = = = = = = =
@ -283,25 +214,21 @@ endif()
# P l a t f o r m - s p e c i f i c l i b r a r y r e q u i r e m e n t s
# P l a t f o r m - s p e c i f i c l i b r a r y r e q u i r e m e n t s
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
# = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
IF ( APPLE )
if ( APPLE )
find_library ( COCOA_LIBRARY Cocoa ) # U m b r e l l a f r a m e w o r k f o r e v e r y t h i n g G U I - r e l a t e d
# U m b r e l l a f r a m e w o r k f o r e v e r y t h i n g G U I - r e l a t e d
find_library ( COCOA_LIBRARY Cocoa )
set ( PLATFORM_LIBRARIES ${ COCOA_LIBRARY } ${ IOKIT_LIBRARY } ${ COREVIDEO_LIBRARY } )
set ( PLATFORM_LIBRARIES ${ COCOA_LIBRARY } ${ IOKIT_LIBRARY } ${ COREVIDEO_LIBRARY } )
elseif ( WIN32 )
if ( CMAKE_CXX_COMPILER_ID STREQUAL Clang )
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++" )
set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -stdlib=libc++" )
endif ( )
ELSEIF ( WIN32 )
# W S A P o l l a n d SHGetKnownFolderPath ( AppData/Roaming ) d i d n ' t e x i s t b e f o r e W i n N T 6 . x ( Vista )
# W S A P o l l a n d SHGetKnownFolderPath ( AppData/Roaming ) d i d n ' t e x i s t b e f o r e W i n N T 6 . x ( Vista )
add_definitions ( -D_WIN32_WINNT=0x0600 -DWINVER=0x0600 )
add_definitions ( -D_WIN32_WINNT=0x0600 -DWINVER=0x0600 )
set ( PLATFORM_LIBRARIES winmm ws2_32 )
set ( PLATFORM_LIBRARIES winmm ws2_32 )
IF ( MINGW )
if ( MINGW )
# P S A P I i s t h e P r o c e s s S t a t u s A P I
# P S A P I i s t h e P r o c e s s S t a t u s A P I
set ( PLATFORM_LIBRARIES ${ PLATFORM_LIBRARIES } psapi imm32 version )
set ( PLATFORM_LIBRARIES ${ PLATFORM_LIBRARIES } psapi imm32 version )
ENDIF ( MINGW )
endif( )
ELSEIF ( CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU|SunOS)$" )
elseif ( CMAKE_SYSTEM_NAME MATCHES "^(Linux|kFreeBSD|GNU|SunOS)$" )
set ( PLATFORM_LIBRARIES rt )
set ( PLATFORM_LIBRARIES rt )
ENDIF ( APPLE )
endif( )
# S e t u p a c u s t o m c l a n g - f o r m a t target ( if clang-format can be found ) t h a t w i l l r u n
# S e t u p a c u s t o m c l a n g - f o r m a t target ( if clang-format can be found ) t h a t w i l l r u n
# a g a i n s t a l l t h e s r c f i l e s . T h i s s h o u l d b e u s e d b e f o r e m a k i n g a p u l l r e q u e s t .
# a g a i n s t a l l t h e s r c f i l e s . T h i s s h o u l d b e u s e d b e f o r e m a k i n g a p u l l r e q u e s t .