Skip to content

Commit

Permalink
CMake: Enable multi-processor builds for MSVC toolchain
Browse files Browse the repository at this point in the history
When MSVC is detected, add the `/MP` option to the compile flags for
all targets. This enables multi-processor (multi-core) builds per
translation unit being compiled.

Fixes Orphis#69

Signed-off-by: Robert Dailey <[email protected]>
  • Loading branch information
rcdailey committed Dec 21, 2018
1 parent d04f7df commit 80f792f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ if(USE_ANDROID)
# CMake 3.7.1 doesn't define the target triple for the ASM language,
# resulting in all files compiled for the host architecture
set(CMAKE_ASM_COMPILER_TARGET "${CMAKE_CXX_COMPILER_TARGET}")
elseif( MSVC )
string(APPEND CMAKE_CXX_FLAGS " /MP")
endif()

set(BOOST_LIBS_REQUIRED
Expand Down

0 comments on commit 80f792f

Please sign in to comment.