diff options
| -rw-r--r-- | CMakeLists.txt | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 638b468a6..af53bda71 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -11,6 +11,25 @@ else() | |||
| 11 | add_definitions(/D_CRT_SECURE_NO_WARNINGS) | 11 | add_definitions(/D_CRT_SECURE_NO_WARNINGS) |
| 12 | # set up output paths for executable binaries (.exe-files, and .dll-files on DLL-capable platforms) | 12 | # set up output paths for executable binaries (.exe-files, and .dll-files on DLL-capable platforms) |
| 13 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | 13 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) |
| 14 | |||
| 15 | # Tweak optimization settings | ||
| 16 | # As far as I can tell, there's no way to override the CMake defaults while leaving user | ||
| 17 | # changes intact, so we'll just clobber everything and say sorry. | ||
| 18 | message(STATUS "Cache compiler flags ignored, please edit CMakeFiles.txt to change the flags.") | ||
| 19 | # /MD - Multi-threaded runtime | ||
| 20 | # /Ox - Full optimization | ||
| 21 | # /Oi - Use intrinsic functions | ||
| 22 | # /Oy- - Don't omit frame pointer | ||
| 23 | # /GR- - Disable RTTI | ||
| 24 | # /GS- - No stack buffer overflow checks | ||
| 25 | # /EHsc - C++-only exception handling semantics | ||
| 26 | set(optimization_flags "/MD /Ox /Oi /Oy- /DNDEBUG /GR- /GS- /EHsc") | ||
| 27 | # /Zi - Output debugging information | ||
| 28 | # /Zo - enahnced debug info for optimized builds | ||
| 29 | set(CMAKE_C_FLAGS_RELEASE "${optimization_flags} /Zi" CACHE STRING "" FORCE) | ||
| 30 | set(CMAKE_CXX_FLAGS_RELEASE "${optimization_flags} /Zi" CACHE STRING "" FORCE) | ||
| 31 | set(CMAKE_C_FLAGS_RELWITHDEBINFO "${optimization_flags} /Zi /Zo" CACHE STRING "" FORCE) | ||
| 32 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${optimization_flags} /Zi /Zo" CACHE STRING "" FORCE) | ||
| 14 | endif() | 33 | endif() |
| 15 | add_definitions(-DSINGLETHREADED) | 34 | add_definitions(-DSINGLETHREADED) |
| 16 | 35 | ||