@ -22,32 +22,34 @@ else()
# s e t u p o u t p u t p a t h s f o r e x e c u t a b l e binaries ( .exe-files, and .dll-files on DLL-capable platforms )
set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ CMAKE_BINARY_DIR } /bin )
set ( CMAKE_CONFIGURATION_TYPES Debug Release RelWithDebInfo 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
# 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." )
# / O 2 - O p t i m i z a t i o n l e v e l 2
# / O y - - D o n ' t o m i t f r a m e p o i n t e r
# / G R - - D i s a b l e R T T I
# / 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
# / 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
set ( optimization_flags "/O2 /Oy- /GR- /GS- /EHsc" )
# / 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 a h 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
# / 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 "/MP /MDd /Zi" CACHE STRING "" FORCE )
set ( CMAKE_CXX_FLAGS_DEBUG "/MP /MDd /Zi" CACHE STRING "" FORCE )
# / 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 "${optimization_flags} /MP /MD" CACHE STRING "" FORCE )
set ( CMAKE_CXX_FLAGS_RELEASE "${optimization_flags} /MP /MD" CACHE STRING "" FORCE )
set ( CMAKE_C_FLAGS_RELWITHDEBINFO "${optimization_flags} /MP /MD /Zi /Zo" CACHE STRING "" FORCE )
set ( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${optimization_flags} /MP /MD /Zi /Zo" CACHE STRING "" FORCE )
set ( CMAKE_C_FLAGS "/W3 /MP /Zi /Zo" CACHE STRING "" FORCE )
# / G R - - D i s a b l e R T T I
# / 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
set ( CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} /GR- /EHsc" CACHE STRING "" FORCE )
set ( CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE STRING "" FORCE )
set ( CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/DEBUG" 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" CACHE STRING "" FORCE )
set ( CMAKE_EXE_LINKER_FLAGS_RELEASE "/DEBUG" CACHE STRING "" FORCE )
endif ( )
add_definitions ( -DSINGLETHREADED )