summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bunnei2014-12-21 21:58:31 -0500
committerGravatar bunnei2014-12-21 21:58:31 -0500
commitb9ef8b3fd2a252142c89bc2a8e1facc9e81d9968 (patch)
treee9cace6410521e09a5a9cd6785f421353d3031fc
parentMerge pull request #332 from lioncash/sel (diff)
parentCMake: Silence PNG not found error (diff)
downloadyuzu-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.txt25
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)
14endif() 33endif()
15add_definitions(-DSINGLETHREADED) 34add_definitions(-DSINGLETHREADED)
16 35
17find_package(PNG) 36find_package(PNG QUIET)
18if (PNG_FOUND) 37if (PNG_FOUND)
19 add_definitions(-DHAVE_PNG) 38 add_definitions(-DHAVE_PNG)
20endif () 39else()
40 message(STATUS "libpng not found. Some debugging features have been disabled.")
41endif()
21 42
22find_package(Boost) 43find_package(Boost)
23if (Boost_FOUND) 44if (Boost_FOUND)