Skip to content

Commit

Permalink
Better CPU count detection when choosing build threads.
Browse files Browse the repository at this point in the history
  • Loading branch information
clangen committed Sep 10, 2023
1 parent dc6e779 commit ab32554
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions script/archive-standalone-nix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ fi
OS=$(uname)

JOBS="-j8"
if [[ $OS == "Darwin" ]]; then
JOBS="-j$(sysctl -n hw.ncpu)"
elif nproc &> /dev/null; then
JOBS="-j$(nproc)"
fi

FRIENDLY_OS_NAME="linux"
if [[ $OS == "Darwin" ]]; then
Expand Down
2 changes: 2 additions & 0 deletions script/build-vendor-libraries.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ LIBDIR="$OUTDIR/lib"
JOBS="-j8"
if [[ $OS == "Darwin" ]]; then
JOBS="-j$(sysctl -n hw.ncpu)"
elif nproc &> /dev/null; then
JOBS="-j$(nproc)"
fi

OPENSSL_TYPE="linux-${ARCH}"
Expand Down

0 comments on commit ab32554

Please sign in to comment.