cut down threads num for compiling in windows with msvc

This commit is contained in:
Bowen Ma 2022-10-08 19:29:11 +08:00
parent d8c6dd14b4
commit e37df1f1c8
1 changed files with 1 additions and 1 deletions

View File

@ -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")