From 80f792f79d7367bf1b150911c9e6594e7185bb92 Mon Sep 17 00:00:00 2001 From: Robert Dailey Date: Wed, 6 Sep 2017 10:08:30 -0500 Subject: [PATCH] CMake: Enable multi-processor builds for MSVC toolchain 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 #69 Signed-off-by: Robert Dailey --- CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index aaddbd670..948e43b81 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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