From bbaa65975199168cdfa7a3488fb9da6f20fa4ddc Mon Sep 17 00:00:00 2001 From: Cody Northrop Date: Fri, 2 Dec 2016 09:28:42 -0700 Subject: toolchain: Fix core count in script for macOS This could also switch to using gnproc from brew if needed in the future. --- update_external_sources.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/update_external_sources.sh b/update_external_sources.sh index 9db212fe..3c4df786 100755 --- a/update_external_sources.sh +++ b/update_external_sources.sh @@ -5,10 +5,13 @@ set -e if [[ $(uname) == "Linux" ]]; then CURRENT_DIR="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")" + CORE_COUNT=$(nproc || echo 4) elif [[ $(uname) == "Darwin" ]]; then # Get greadlink with "brew install coreutils" CURRENT_DIR="$(dirname "$(greadlink -f ${BASH_SOURCE[0]})")" + CORE_COUNT=$(sysctl -n hw.ncpu || echo 4) fi +echo CORE_COUNT=$CORE_COUNT REVISION_DIR="$CURRENT_DIR/external_revisions" @@ -73,7 +76,7 @@ function build_glslang () { mkdir -p build cd build cmake -D CMAKE_BUILD_TYPE=Release .. - make -j $(nproc) + make -j $CORE_COUNT make install } @@ -83,7 +86,7 @@ function build_spirv-tools () { mkdir -p build cd build cmake -D CMAKE_BUILD_TYPE=Release .. - make -j $(nproc) + make -j $CORE_COUNT } # If any options are provided, just compile those tools -- cgit v1.2.3