From: Cody Northrop Date: Fri, 29 Sep 2017 21:34:45 +0000 (-0600) Subject: android: Update toolchain build to handle single ABI X-Git-Tag: upstream/1.1.92~745 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f220a620607ab5b580933df82a70bbf7d4aa2abf;p=platform%2Fupstream%2FVulkan-Tools.git 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. --- diff --git a/.travis.yml b/.travis.yml index 7249da1..a95ea05 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 b1ee742..be1b410 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 (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