build_engine/editor.sh: Use sysctl on OpenBSD to get number of cores.

This commit is contained in:
Marco Cawthorne 2021-05-09 22:01:13 +02:00
parent 29e0e82f48
commit 1de7864463
2 changed files with 12 additions and 4 deletions

View File

@ -14,8 +14,12 @@ COMPILE_SYS=$(uname)
# Check how many cores/processors we should use for building
if ! [ -x "$(command -v nproc)" ]; then
# nproc doesn't exist, so make a safe assumption of having at least 1
BUILD_PROC=1
# check if we're on OpenBSD then
if ! [ -x "$(command -v sysctl)" ]; then
BUILD_PROC=1
else
BUILD_PROC=$(sysctl -n hw.ncpu)
fi
else
BUILD_PROC=$(nproc)
fi

View File

@ -8,8 +8,12 @@ COMPILE_SYS=$(uname)
# Check how many cores/processors we should use for building
if ! [ -x "$(command -v nproc)" ]; then
# nproc doesn't exist, so make a safe assumption of having at least 1
BUILD_PROC=1
# check if we're on OpenBSD then
if ! [ -x "$(command -v sysctl)" ]; then
BUILD_PROC=1
else
BUILD_PROC=$(sysctl -n hw.ncpu)
fi
else
BUILD_PROC=$(nproc)
fi