mirror of
https://gitlab.kitware.com/cmake/cmake.git
synced 2026-10-06 04:03:27 +03:00
ProcessorCount: make it work on Haiku
This commit is contained in:
1 parent
845cdbc60e
commit
eef42a0de6
1 file changed
+14
@@ -182,6 +182,20 @@ function(ProcessorCount var)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(NOT count)
|
||||
# Haiku
|
||||
find_program(ProcessorCount_cmd_sysinfo sysinfo)
|
||||
if(ProcessorCount_cmd_sysinfo)
|
||||
execute_process(COMMAND ${ProcessorCount_cmd_sysinfo}
|
||||
ERROR_QUIET
|
||||
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||
OUTPUT_VARIABLE sysinfo_X_output)
|
||||
string(REGEX MATCHALL "\nCPU #[0-9]+:" procs "\n${sysinfo_X_output}")
|
||||
list(LENGTH procs count)
|
||||
#message("ProcessorCount: trying sysinfo '${ProcessorCount_cmd_sysinfo}'")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Since cygwin builds of CMake do not define WIN32 anymore, but they still
|
||||
# run on Windows, and will still have this env var defined:
|
||||
#
|
||||
|
||||
Reference in new issue
Block a user