fix(build): number of core detection on OSX
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
77537d43a3
commit
725f370e59
1 changed files with 2 additions and 6 deletions
|
@ -281,12 +281,8 @@ if(NOT DEFINED PROCESSOR_COUNT)
|
|||
|
||||
# Mac:
|
||||
if(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
find_program(cmd_sys_pro "system_profiler")
|
||||
if(cmd_sys_pro)
|
||||
execute_process(COMMAND ${cmd_sys_pro} OUTPUT_VARIABLE info)
|
||||
string(REGEX REPLACE "^.*Total Number Of Cores: ([0-9]+).*$" "\\1"
|
||||
PROCESSOR_COUNT "${info}")
|
||||
endif()
|
||||
execute_process(COMMAND "sysctl" "hw.ncpu" OUTPUT_VARIABLE info)
|
||||
string(REGEX REPLACE "^hw.ncpu: ([0-9]+).*$" "\\1" PROCESSOR_COUNT "${info}")
|
||||
endif()
|
||||
|
||||
# Windows:
|
||||
|
|
Loading…
Reference in a new issue