nproc is Linux-specific, but you can do the same with sysctl on a Mac

This commit is contained in:
T. Joseph Carter 2015-04-05 22:17:32 -07:00
parent d595b636b8
commit 0e94fea288

View File

@ -171,8 +171,11 @@ case "$platform" in
config_log_build_host
if [ -z "$JOBS" ]; then
# nproc is generally Linux-specific.
if command -v nproc >/dev/null; then
JOBS="$(nproc)"
elif [ "$pltaform" = "osx" ] && command -v sysctl >/dev/null; then
JOBS="$(sysctl -n hw.physicalcpu)"
else
JOBS=1
fi