diff options
| author | 2014-12-21 21:58:31 -0500 | |
|---|---|---|
| committer | 2014-12-21 21:58:31 -0500 | |
| commit | b9ef8b3fd2a252142c89bc2a8e1facc9e81d9968 (patch) | |
| tree | e9cace6410521e09a5a9cd6785f421353d3031fc | |
| parent | Merge pull request #332 from lioncash/sel (diff) | |
| parent | CMake: Silence PNG not found error (diff) | |
| download | yuzu-b9ef8b3fd2a252142c89bc2a8e1facc9e81d9968.tar.gz yuzu-b9ef8b3fd2a252142c89bc2a8e1facc9e81d9968.tar.xz yuzu-b9ef8b3fd2a252142c89bc2a8e1facc9e81d9968.zip | |
Merge pull request #325 from yuriks/cmake-opts
CMake: Turn MSVC optimizations up to 11
| -rw-r--r-- | CMakeLists.txt | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 638b468a6..1491df6e6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
| @@ -11,13 +11,34 @@ 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 | ||
| 17 | find_package(PNG) | 36 | find_package(PNG QUIET) |
| 18 | if (PNG_FOUND) | 37 | if (PNG_FOUND) |
| 19 | add_definitions(-DHAVE_PNG) | 38 | add_definitions(-DHAVE_PNG) |
| 20 | endif () | 39 | else() |
| 40 | message(STATUS "libpng not found. Some debugging features have been disabled.") | ||
| 41 | endif() | ||
| 21 | 42 | ||
| 22 | find_package(Boost) | 43 | find_package(Boost) |
| 23 | if (Boost_FOUND) | 44 | if (Boost_FOUND) |