From e37df1f1c87872721ba69ee1daf5dbad0f4b5c28 Mon Sep 17 00:00:00 2001 From: Bowen Ma Date: Sat, 8 Oct 2022 19:29:11 +0800 Subject: [PATCH] cut down threads num for compiling in windows with msvc --- cmake/init.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/init.cmake b/cmake/init.cmake index 8296481d422..f653b223d81 100644 --- a/cmake/init.cmake +++ b/cmake/init.cmake @@ -12,7 +12,7 @@ if(MSVC) message("init cxx_flags on windows") cmake_host_system_information(RESULT CPU_CORES QUERY NUMBER_OF_LOGICAL_CORES) message("CPU_CORE number = ${CPU_CORES}") - math(EXPR MP_NUM "${CPU_CORES} * 2") + math(EXPR MP_NUM "${CPU_CORES}") set(CMAKE_C_FLAGS "/MD /O2 /Ob2 /DNDEBUG /MP${MP_NUM} /EHsc /bigobj") set(CMAKE_C_FLAGS_DEBUG "/MDd /Zi /Ob0 /Od /RTC1 /MP${MP_NUM} /EHsc /bigobj") set(CMAKE_C_FLAGS_RELEASE "/MD /O2 /Ob2 /DNDEBUG /MP${MP_NUM} /EHsc /bigobj")