Skip to content

Commit efaec58

Browse files
committed
Use native CMake functionality
1 parent 040a4e6 commit efaec58

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Modules/NProc.cmake

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@
22
# The newline is trimmed from the result using the `tr -d '\n'` command.
33

44
if(APPLE)
5-
execute_process(COMMAND sysctl -n hw.logicalcpu COMMAND tr -d '\n' OUTPUT_VARIABLE NPROC)
5+
execute_process(
6+
COMMAND sysctl -n hw.logicalcpu
7+
OUTPUT_VARIABLE NPROC
8+
OUTPUT_STRIP_TRAILING_WHITESPACE
9+
)
610
elseif(LINUX)
7-
execute_process(COMMAND nproc COMMAND tr -d '\n' OUTPUT_VARIABLE NPROC)
11+
execute_process(COMMAND nproc OUTPUT_VARIABLE NPROC OUTPUT_STRIP_TRAILING_WHITESPACE)
812
endif()

0 commit comments

Comments
 (0)