From 5d2e477f06cb8c2d2c20bd59364a1c0d3c6a6b44 Mon Sep 17 00:00:00 2001 From: Dav999-v Date: Tue, 21 Mar 2023 23:15:23 +0100 Subject: [PATCH] Add /MP to CMakeLists for Windows This should make compilation on Windows faster because it uses multiple processors. The Windows CI is the slowest, so let's make it faster. From my experimentation, adding this flag does seem to reduce compile times, especially after the first build (default version) is done. https://learn.microsoft.com/en-us/cpp/build/reference/mp-build-with-multiple-processes?view=msvc-170 --- desktop_version/CMakeLists.txt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/desktop_version/CMakeLists.txt b/desktop_version/CMakeLists.txt index 7c2beec4..2bbc77ef 100644 --- a/desktop_version/CMakeLists.txt +++ b/desktop_version/CMakeLists.txt @@ -350,8 +350,9 @@ endif() if(MSVC) - # Statically link Microsoft's runtime library so end users don't have to install it - list(APPEND GLOBAL_COMPILE_FLAGS /MT) + # Statically link Microsoft's runtime library so end users don't have to install it (/MT) + # Also, build with multiple processors (/MP) + list(APPEND GLOBAL_COMPILE_FLAGS /MT /MP) endif()