aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCody Northrop <cnorthrop@google.com>2017-09-29 15:34:45 -0600
committerCody Northrop <cnorthrop@google.com>2017-09-29 16:31:37 -0600
commitf220a620607ab5b580933df82a70bbf7d4aa2abf (patch)
treee806c4b2e51d067d72f82718d2551ed846a1365b
parent5f43e07378f620e533528f0abd0d3dc49a414a6d (diff)
downloadusermoji-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.
-rw-r--r--.travis.yml2
-rwxr-xr-xbuild-android/update_external_sources_android.sh50
2 files changed, 50 insertions, 2 deletions
diff --git a/.travis.yml b/.travis.yml
index 7249da16..a95ea05e 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -54,7 +54,7 @@ script:
- if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then cmake -H. -Bdbuild -DCMAKE_BUILD_TYPE=Debug; fi
- if [[ "$VULKAN_BUILD_TARGET" == "LINUX" ]]; then make -C dbuild; fi
- if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then pushd build-android; fi
- - if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then ./update_external_sources_android.sh; fi
+ - if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then ./update_external_sources_android.sh --abi $ANDROID_ABI; fi
- if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then ./android-generate.sh; fi
- if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then ndk-build APP_ABI=$ANDROID_ABI; fi
- if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then popd; fi
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