aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Northrop <cnorthrop@google.com>2016-12-02 09:28:42 -0700
committerCody Northrop <cnorthrop@google.com>2016-12-02 11:33:24 -0700
commitbbaa65975199168cdfa7a3488fb9da6f20fa4ddc (patch)
tree5138ec48f263c7b0721428efe0adb653329e8e7c
parent7269ee133553e81a823de49b0bdad5b866a45c9a (diff)
downloadusermoji-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-xupdate_external_sources.sh7
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