From 623a9123a1deaae4865c53bd8598e8dc4590e9b6 Mon Sep 17 00:00:00 2001 From: Tobias Taschner Date: Thu, 8 Feb 2018 21:13:44 +0100 Subject: [PATCH] CMake: Enable multi-processor compilation for MSVC Add option wxBUILD_MSVC_MULTIPROC which defaults to ON to add /MP the MSVC compiler options. --- build/cmake/init.cmake | 5 +++++ build/cmake/options.cmake | 1 + 2 files changed, 6 insertions(+) diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake index bb17e3fd85..06256b1b1d 100644 --- a/build/cmake/init.cmake +++ b/build/cmake/init.cmake @@ -22,6 +22,11 @@ if(DEFINED wxBUILD_USE_STATIC_RUNTIME AND wxBUILD_USE_STATIC_RUNTIME) endforeach() endif() +if(wxBUILD_MSVC_MULTIPROC) + wx_string_append(CMAKE_C_FLAGS " /MP") + wx_string_append(CMAKE_CXX_FLAGS " /MP") +endif() + if(wxBUILD_COMPATIBILITY VERSION_LESS 3.0) set(WXWIN_COMPATIBILITY_2_8 ON) endif() diff --git a/build/cmake/options.cmake b/build/cmake/options.cmake index 5d1d9a606e..b01db3261f 100644 --- a/build/cmake/options.cmake +++ b/build/cmake/options.cmake @@ -25,6 +25,7 @@ mark_as_advanced(wxBUILD_CUSTOM_SETUP_HEADER_PATH) if(MSVC) wx_option(wxBUILD_USE_STATIC_RUNTIME "Link using the static runtime library" OFF) + wx_option(wxBUILD_MSVC_MULTIPROC "Enable multi-processor compilation for MSVC") else() # Other compilers support setting the C++ standard, present it an option to the user if(DEFINED CMAKE_CXX_STANDARD)