aboutsummaryrefslogtreecommitdiff
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
commit466341243a3499e71f7b22607ecbc3cba253c016 (patch)
treea7751a6c75dd149c033b080fe257d16437ffe558 /build-android
parent37bb15fb906931f4f3da67eaf3777f4e7622f1a1 (diff)
downloadusermoji-466341243a3499e71f7b22607ecbc3cba253c016.tar.xz
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