summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Yuri Kunde Schlesner2015-01-09 12:42:35 -0200
committerGravatar Yuri Kunde Schlesner2015-01-09 12:42:35 -0200
commitf983d955f9cd01bc07f8c3dddb0565e66a0d2990 (patch)
treecb012468d60f8eeaf3f101718264b2720c1450c7
parentMerge pull request #255 from Subv/cbranch_3 (diff)
downloadyuzu-f983d955f9cd01bc07f8c3dddb0565e66a0d2990.tar.gz
yuzu-f983d955f9cd01bc07f8c3dddb0565e66a0d2990.tar.xz
yuzu-f983d955f9cd01bc07f8c3dddb0565e66a0d2990.zip
CMake: Enable VS parallel builds for a good reduction in compile times
This enables the /MP compiler flag, which parallelizes builds of by distributing compilation of individual object files across workes processes, instead of being limited to per-project parallelism. Reduces the time for a full compile from 72 s to 45 s on my machine.
-rw-r--r--CMakeLists.txt3
1 files changed, 2 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 884520cef..2cba5e8a1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,6 +17,7 @@ else()
17 # As far as I can tell, there's no way to override the CMake defaults while leaving user 17 # As far as I can tell, there's no way to override the CMake defaults while leaving user
18 # changes intact, so we'll just clobber everything and say sorry. 18 # changes intact, so we'll just clobber everything and say sorry.
19 message(STATUS "Cache compiler flags ignored, please edit CMakeFiles.txt to change the flags.") 19 message(STATUS "Cache compiler flags ignored, please edit CMakeFiles.txt to change the flags.")
20 # /MP - Multi-threaded compilation
20 # /MD - Multi-threaded runtime 21 # /MD - Multi-threaded runtime
21 # /Ox - Full optimization 22 # /Ox - Full optimization
22 # /Oi - Use intrinsic functions 23 # /Oi - Use intrinsic functions
@@ -24,7 +25,7 @@ else()
24 # /GR- - Disable RTTI 25 # /GR- - Disable RTTI
25 # /GS- - No stack buffer overflow checks 26 # /GS- - No stack buffer overflow checks
26 # /EHsc - C++-only exception handling semantics 27 # /EHsc - C++-only exception handling semantics
27 set(optimization_flags "/MD /Ox /Oi /Oy- /DNDEBUG /GR- /GS- /EHsc") 28 set(optimization_flags "/MP /MD /Ox /Oi /Oy- /DNDEBUG /GR- /GS- /EHsc")
28 # /Zi - Output debugging information 29 # /Zi - Output debugging information
29 # /Zo - enahnced debug info for optimized builds 30 # /Zo - enahnced debug info for optimized builds
30 set(CMAKE_C_FLAGS_RELEASE "${optimization_flags} /Zi" CACHE STRING "" FORCE) 31 set(CMAKE_C_FLAGS_RELEASE "${optimization_flags} /Zi" CACHE STRING "" FORCE)