diff options
| author | Cody Northrop <cnorthrop@google.com> | 2017-09-29 15:34:45 -0600 |
|---|---|---|
| committer | Cody Northrop <cnorthrop@google.com> | 2017-09-29 16:31:37 -0600 |
| commit | f220a620607ab5b580933df82a70bbf7d4aa2abf (patch) | |
| tree | e806c4b2e51d067d72f82718d2551ed846a1365b /build-android | |
| parent | 5f43e07378f620e533528f0abd0d3dc49a414a6d (diff) | |
| download | usermoji-f220a620607ab5b580933df82a70bbf7d4aa2abf.tar.xz | |
android: Update toolchain build to handle single ABI
This reduces local arm32 toolchain build from 3m30s to 42s.
Also update Travis-CI config to use the new flag, greatly reducing
Android build time.
Diffstat (limited to 'build-android')
| -rwxr-xr-x | build-android/update_external_sources_android.sh | 50 |
1 files changed, 49 insertions, 1 deletions
diff --git a/build-android/update_external_sources_android.sh b/build-android/update_external_sources_android.sh index b1ee742b..be1b410a 100755 --- a/build-android/update_external_sources_android.sh +++ b/build-android/update_external_sources_android.sh @@ -48,6 +48,50 @@ elif [[ $(uname) == "Darwin" ]]; then cores=$(sysctl -n hw.ncpu) fi +# +# Parse parameters +# + +function printUsage { + echo "Supported parameters are:" + echo " --abi <abi> (optional)" + echo + echo "i.e. ${0##*/} --abi arm64-v8a \\" + exit 1 +} + +if [[ $(($# % 2)) -ne 0 ]] +then + echo Parameters must be provided in pairs. + echo parameter count = $# + echo + printUsage + exit 1 +fi + +while [[ $# -gt 0 ]] +do + case $1 in + --abi) + abi="$2" + shift 2 + ;; + *) + # unknown option + echo Unknown option: $1 + echo + printUsage + exit 1 + ;; + esac +done + +echo abi=$abi +if [[ -z $abi ]] +then + echo No abi provided, so building for all supported abis. +fi + function create_glslang () { rm -rf $BASEDIR/glslang echo "Creating local glslang repository ($BASEDIR/glslang)." @@ -135,7 +179,11 @@ function update_shaderc () { function build_shaderc () { echo "Building $BASEDIR/shaderc" cd $BASEDIR/shaderc/android_test - ndk-build THIRD_PARTY_PATH=../.. -j $cores + if [[ $abi ]]; then + ndk-build THIRD_PARTY_PATH=../.. APP_ABI=$abi -j $cores; + else + ndk-build THIRD_PARTY_PATH=../.. -j $cores; + fi } if [ ! -d "$BASEDIR/glslang" -o ! -d "$BASEDIR/glslang/.git" -o -d "$BASEDIR/glslang/.svn" ]; then |
