diff options
| author | 2015-07-10 22:42:56 -0400 | |
|---|---|---|
| committer | 2015-07-10 22:42:56 -0400 | |
| commit | a81991aa68658cc74a0f11203f4a23a5afea3d17 (patch) | |
| tree | 6de3cf98f2285ba760a1dbad3b56df7e1e5ff380 | |
| parent | Merge pull request #916 from lioncash/unused (diff) | |
| parent | CMake: Fix Debug build configuration in MSVC (diff) | |
| download | yuzu-a81991aa68658cc74a0f11203f4a23a5afea3d17.tar.gz yuzu-a81991aa68658cc74a0f11203f4a23a5afea3d17.tar.xz yuzu-a81991aa68658cc74a0f11203f4a23a5afea3d17.zip | |
Merge pull request #909 from yuriks/build-flags
CMake: Fix Debug build configuration in MSVC
Diffstat (limited to '')
| -rw-r--r-- | CMakeLists.txt | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 6805ebed8..3658ef48e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -22,32 +22,34 @@ else() | |||
| 22 | 22 | ||
| 23 | # set up output paths for executable binaries (.exe-files, and .dll-files on DLL-capable platforms) | 23 | # set up output paths for executable binaries (.exe-files, and .dll-files on DLL-capable platforms) |
| 24 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) | 24 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin) |
| 25 | set(CMAKE_CONFIGURATION_TYPES Debug Release RelWithDebInfo CACHE STRING "" FORCE) | 25 | set(CMAKE_CONFIGURATION_TYPES Debug Release CACHE STRING "" FORCE) |
| 26 | 26 | ||
| 27 | # Tweak optimization settings | 27 | # Tweak optimization settings |
| 28 | # As far as I can tell, there's no way to override the CMake defaults while leaving user | 28 | # As far as I can tell, there's no way to override the CMake defaults while leaving user |
| 29 | # changes intact, so we'll just clobber everything and say sorry. | 29 | # changes intact, so we'll just clobber everything and say sorry. |
| 30 | message(STATUS "Cache compiler flags ignored, please edit CMakeLists.txt to change the flags.") | 30 | message(STATUS "Cache compiler flags ignored, please edit CMakeLists.txt to change the flags.") |
| 31 | # /O2 - Optimization level 2 | 31 | |
| 32 | # /Oy- - Don't omit frame pointer | 32 | # /W3 - Level 3 warnings |
| 33 | # /GR- - Disable RTTI | ||
| 34 | # /GS- - No stack buffer overflow checks | ||
| 35 | # /EHsc - C++-only exception handling semantics | ||
| 36 | set(optimization_flags "/O2 /Oy- /GR- /GS- /EHsc") | ||
| 37 | # /MP - Multi-threaded compilation | 33 | # /MP - Multi-threaded compilation |
| 38 | # /Zi - Output debugging information | 34 | # /Zi - Output debugging information |
| 39 | # /Zo - enahnced debug info for optimized builds | 35 | # /Zo - enahnced debug info for optimized builds |
| 36 | set(CMAKE_C_FLAGS "/W3 /MP /Zi /Zo" CACHE STRING "" FORCE) | ||
| 37 | # /GR- - Disable RTTI | ||
| 38 | # /EHsc - C++-only exception handling semantics | ||
| 39 | set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} /GR- /EHsc" CACHE STRING "" FORCE) | ||
| 40 | |||
| 40 | # /MDd - Multi-threaded Debug Runtime DLL | 41 | # /MDd - Multi-threaded Debug Runtime DLL |
| 41 | set(CMAKE_C_FLAGS_DEBUG "/MP /MDd /Zi" CACHE STRING "" FORCE) | 42 | set(CMAKE_C_FLAGS_DEBUG "/Od /MDd" CACHE STRING "" FORCE) |
| 42 | set(CMAKE_CXX_FLAGS_DEBUG "/MP /MDd /Zi" CACHE STRING "" FORCE) | 43 | set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}" CACHE STRING "" FORCE) |
| 44 | |||
| 45 | # /O2 - Optimization level 2 | ||
| 46 | # /GS- - No stack buffer overflow checks | ||
| 43 | # /MD - Multi-threaded runtime DLL | 47 | # /MD - Multi-threaded runtime DLL |
| 44 | set(CMAKE_C_FLAGS_RELEASE "${optimization_flags} /MP /MD" CACHE STRING "" FORCE) | 48 | set(CMAKE_C_FLAGS_RELEASE "/O2 /GS- /MD" CACHE STRING "" FORCE) |
| 45 | set(CMAKE_CXX_FLAGS_RELEASE "${optimization_flags} /MP /MD" CACHE STRING "" FORCE) | 49 | set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}" CACHE STRING "" FORCE) |
| 46 | set(CMAKE_C_FLAGS_RELWITHDEBINFO "${optimization_flags} /MP /MD /Zi /Zo" CACHE STRING "" FORCE) | ||
| 47 | set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${optimization_flags} /MP /MD /Zi /Zo" CACHE STRING "" FORCE) | ||
| 48 | 50 | ||
| 49 | set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE STRING "" FORCE) | 51 | set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/DEBUG" CACHE STRING "" FORCE) |
| 50 | set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "/DEBUG" CACHE STRING "" FORCE) | 52 | set(CMAKE_EXE_LINKER_FLAGS_RELEASE "/DEBUG" CACHE STRING "" FORCE) |
| 51 | endif() | 53 | endif() |
| 52 | 54 | ||
| 53 | add_definitions(-DSINGLETHREADED) | 55 | add_definitions(-DSINGLETHREADED) |