summaryrefslogtreecommitdiff
path: root/build-android
diff options
context:
space:
mode:
authorCody Northrop <cnorthrop@google.com>2016-11-03 14:35:08 -0600
committerCody Northrop <cnorthrop@google.com>2016-11-14 15:07:01 -0700
commite667e92c0739ac0788b0512e8517c07ddcc90585 (patch)
tree562a1ca1ee515b74fbf41e7c881e80c15d5998e0 /build-android
parent2f7423e2ef2a5a6edbdd672684bb7e21ef438a21 (diff)
android: Build toolchain with more cores
Diffstat (limited to 'build-android')
-rwxr-xr-xbuild-android/update_external_sources_android.sh8
1 files changed, 7 insertions, 1 deletions
diff --git a/build-android/update_external_sources_android.sh b/build-android/update_external_sources_android.sh
index 588191fb..8f90da62 100755
--- a/build-android/update_external_sources_android.sh
+++ b/build-android/update_external_sources_android.sh
@@ -31,6 +31,12 @@ echo "GLSLANG_REVISION=$GLSLANG_REVISION"
echo "SPIRV_TOOLS_REVISION=$SPIRV_TOOLS_REVISION"
echo "SHADERC_REVISION=$SHADERC_REVISION"
+if [[ $(uname) == "Linux" ]]; then
+ cores=$(ncpus)
+elif [[ $(uname) == "Darwin" ]]; then
+ cores=$(sysctl -n hw.ncpu)
+fi
+
function create_glslang () {
rm -rf $BASEDIR/glslang
echo "Creating local glslang repository ($BASEDIR/glslang)."
@@ -98,7 +104,7 @@ function update_shaderc () {
function build_shaderc () {
echo "Building $BASEDIR/shaderc"
cd $BASEDIR/shaderc/android_test
- ndk-build THIRD_PARTY_PATH=../.. -j 4
+ ndk-build THIRD_PARTY_PATH=../.. -j $cores
}
if [ ! -d "$BASEDIR/glslang" -o ! -d "$BASEDIR/glslang/.git" -o -d "$BASEDIR/glslang/.svn" ]; then