!43369 cut down compiler threads num to meet msvc compiling under Windows

Merge pull request !43369 from iambowen1984/master
This commit is contained in:
i-robot 2022-10-09 06:21:18 +00:00 committed by Gitee
commit 5d2d11e950
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
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")