Skip to content

Commit

Permalink
Uses sysctl -n hw.logicalcpu instead of nproc on macOS (#1307)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jouzo authored May 30, 2022
1 parent e49f868 commit c5b2f65
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions make.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,13 @@ setup_vars() {
default_compiler_flags="CC=clang-11 CXX=clang++-11"
fi

MAKE_JOBS=${MAKE_JOBS:-$(nproc)}
if [[ "${OSTYPE}" == "darwin"* ]]; then
default_jobs=$(sysctl -n hw.logicalcpu)
else
default_jobs=$(nproc)
fi

MAKE_JOBS=${MAKE_JOBS:-"${default_jobs}"}
MAKE_COMPILER=${MAKE_COMPILER:-"${default_compiler_flags}"}
MAKE_CONF_ARGS="${MAKE_COMPILER} ${MAKE_CONF_ARGS:-}"
MAKE_ARGS=${MAKE_ARGS:-}
Expand Down Expand Up @@ -289,7 +295,7 @@ docker_release_git() {
}

docker_build_deploy_git() {
git_version
git_version
docker_build "$@"
docker_deploy "$@"
}
Expand Down

0 comments on commit c5b2f65

Please sign in to comment.