From d90f271c486beb09601970fd41cb5cbcac55bce9 Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 1 Nov 2020 11:55:51 +0300 Subject: [PATCH] Add TD_ENABLE_MULTI_PROCESSOR_COMPILATION option for MSVC. GitOrigin-RevId: f5500b79eb83a20d7ffc1c73963fa3f29fc90012 --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 733b77694..c46fd8699 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,6 +118,14 @@ endif() include(TdSetUpCompiler) td_set_up_compiler() +if (MSVC) + option(TD_ENABLE_MULTI_PROCESSOR_COMPILATION "Use \"ON\" to enable multi-processor compilation.") + + if (TD_ENABLE_MULTI_PROCESSOR_COMPILATION) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") + endif() +endif() + if (CLANG OR GCC) if (MEMPROF) include(CheckCXXCompilerFlag)