diff --git a/CMakeLists.txt b/CMakeLists.txt index 042baf9..08ddc97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,13 @@ option(CTI_CONTINUABLE_WITH_LIGHT_TESTS "Disable some template heavy unit tests (for CI usage)" OFF) +# Top level project settings only +if (IS_TOP_LEVEL_PROJECT) + set(CTI_CONTINUABLE_WITH_CONCURRENT_JOBS + "0" CACHE STRING + "Set the number of concurrent compilation jobs (0 = unlimited, for CI usage)") +endif() + include(cmake/CMakeLists.txt) set(THREADS_PREFER_PTHREAD_FLAG ON) diff --git a/cmake/compiler/msvc.cmake b/cmake/compiler/msvc.cmake index 340456f..74f5705 100644 --- a/cmake/compiler/msvc.cmake +++ b/cmake/compiler/msvc.cmake @@ -31,9 +31,18 @@ if (PLATFORM EQUAL 64) -D_WIN64) endif() +if (CTI_CONTINUABLE_WITH_CONCURRENT_JOBS) + target_compile_options(continuable-features-flags + INTERFACE + /MP${CTI_CONTINUABLE_WITH_CONCURRENT_JOBS}) +else() + target_compile_options(continuable-features-flags + INTERFACE + /MP) +endif() + target_compile_options(continuable-features-flags INTERFACE - /MP2 /bigobj /permissive-)