diff options
| author | Cody Northrop <cnorthrop@google.com> | 2016-12-02 09:28:42 -0700 |
|---|---|---|
| committer | Cody Northrop <cnorthrop@google.com> | 2016-12-02 11:33:24 -0700 |
| commit | bbaa65975199168cdfa7a3488fb9da6f20fa4ddc (patch) | |
| tree | 5138ec48f263c7b0721428efe0adb653329e8e7c | |
| parent | 7269ee133553e81a823de49b0bdad5b866a45c9a (diff) | |
| download | usermoji-bbaa65975199168cdfa7a3488fb9da6f20fa4ddc.tar.xz | |
toolchain: Fix core count in script for macOS
This could also switch to using gnproc from brew if needed in the future.
| -rwxr-xr-x | update_external_sources.sh | 7 |
1 files 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 |
