diff options
author | Karl Schultz <karl@lunarg.com> | 2018-06-06 11:13:37 -0600 |
---|---|---|
committer | Karl Schultz <karl@lunarg.com> | 2018-06-06 16:46:14 -0600 |
commit | f67463d3b5531f522a1c4935a5849bd9e6fe5e3a (patch) | |
tree | dc4320db69e444679237d328213f09d53778cca3 | |
parent | 18119079d3d20f94639dae9c28830b85dfc16d90 (diff) | |
download | Vulkan-Tools-f67463d3b5531f522a1c4935a5849bd9e6fe5e3a.tar.gz Vulkan-Tools-f67463d3b5531f522a1c4935a5849bd9e6fe5e3a.tar.bz2 Vulkan-Tools-f67463d3b5531f522a1c4935a5849bd9e6fe5e3a.zip |
android: Fix CI for Android
-rw-r--r-- | .travis.yml | 17 | ||||
-rw-r--r-- | build-android/glslang_revision_android | 1 | ||||
-rw-r--r-- | build-android/glslang_url_android | 1 | ||||
-rw-r--r-- | build-android/spirv-headers_revision_android | 1 | ||||
-rw-r--r-- | build-android/spirv-headers_url_android | 1 | ||||
-rwxr-xr-x | build-android/update_external_sources_android.bat | 60 | ||||
-rwxr-xr-x | build-android/update_external_sources_android.sh | 72 | ||||
-rw-r--r-- | build-android/vulkan-headers_revision_android | 1 | ||||
-rw-r--r-- | build-android/vulkan-headers_url_android | 1 | ||||
-rw-r--r-- | cube/android/jni/Android.mk | 2 |
10 files changed, 128 insertions, 29 deletions
diff --git a/.travis.yml b/.travis.yml index f3ca5b4d..e2132dc2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,15 +12,13 @@ matrix: - env: CHECK_COMMIT_FORMAT=ON include: # Android build. -# Temporary Disable -# - os: linux -# compiler: gcc -# env: VULKAN_BUILD_TARGET=ANDROID ANDROID_TARGET=android-23 ANDROID_ABI=armeabi-v7a + - os: linux + compiler: gcc + env: VULKAN_BUILD_TARGET=ANDROID ANDROID_TARGET=android-23 ANDROID_ABI=armeabi-v7a # Android 64-bit build. -# Temporary Disable -# - os: linux -# compiler: gcc -# env: VULKAN_BUILD_TARGET=ANDROID ANDROID_TARGET=android-23 ANDROID_ABI=arm64-v8a + - os: linux + compiler: gcc + env: VULKAN_BUILD_TARGET=ANDROID ANDROID_TARGET=android-23 ANDROID_ABI=arm64-v8a # Linux GCC debug build. - os: linux compiler: gcc @@ -124,6 +122,9 @@ script: fi - | if [[ "$VULKAN_BUILD_TARGET" == "ANDROID" ]]; then + pushd ${TRAVIS_BUILD_DIR}/build-android + ./update_external_sources_android.sh --abi $ANDROID_ABI --no-build + popd pushd ${TRAVIS_BUILD_DIR}/cube/android USE_CCACHE=1 NDK_CCACHE=ccache ndk-build APP_ABI=$ANDROID_ABI -j $core_count popd diff --git a/build-android/glslang_revision_android b/build-android/glslang_revision_android new file mode 100644 index 00000000..8843893c --- /dev/null +++ b/build-android/glslang_revision_android @@ -0,0 +1 @@ +23ea3db3e5ea16b4964e9e3b5fee88bfc267fc57 diff --git a/build-android/glslang_url_android b/build-android/glslang_url_android new file mode 100644 index 00000000..d6610008 --- /dev/null +++ b/build-android/glslang_url_android @@ -0,0 +1 @@ +https://github.com/KhronosGroup/glslang.git diff --git a/build-android/spirv-headers_revision_android b/build-android/spirv-headers_revision_android new file mode 100644 index 00000000..f6cc8e50 --- /dev/null +++ b/build-android/spirv-headers_revision_android @@ -0,0 +1 @@ +ce309203d7eceaf908bea8862c27f3e0749f7d00 diff --git a/build-android/spirv-headers_url_android b/build-android/spirv-headers_url_android new file mode 100644 index 00000000..c37214f0 --- /dev/null +++ b/build-android/spirv-headers_url_android @@ -0,0 +1 @@ +https://github.com/KhronosGroup/SPIRV-Headers.git diff --git a/build-android/update_external_sources_android.bat b/build-android/update_external_sources_android.bat index 886625df..96823a33 100755 --- a/build-android/update_external_sources_android.bat +++ b/build-android/update_external_sources_android.bat @@ -1,5 +1,5 @@ @echo off -REM Update source for glslang, spirv-tools, and shaderc +REM Update source for glslang, spirv-tools, shaderc, vulkan-headers REM REM Copyright 2016 The Android Open Source Project @@ -27,6 +27,7 @@ set GLSLANG_DIR=%BASE_DIR%\shaderc\third_party\glslang set SPIRV_TOOLS_DIR=%BASE_DIR%\shaderc\third_party\spirv-tools set SPIRV_HEADERS_DIR=%BASE_DIR%\shaderc\third_party\spirv-tools\external\spirv-headers set SHADERC_DIR=%BASE_DIR%\shaderc +set VULKAN_HEADERS_DIR=%BASE_DIR%\Vulkan-Headers for %%X in (where.exe) do (set FOUND=%%~$PATH:X) if not defined FOUND ( @@ -93,23 +94,33 @@ if not exist %ANDROID_BUILD_DIR%\shaderc_revision_android ( goto:error ) +if not exist %ANDROID_BUILD_DIR%\vulkan-headers_revision_android ( + echo. + echo Missing vulkan-headers_revision_android file. Place it in %ANDROID_BUILD_DIR% + set errorCode=1 + goto:error +) + set /p GLSLANG_REVISION= < glslang_revision_android set /p SPIRV_TOOLS_REVISION= < spirv-tools_revision_android set /p SPIRV_HEADERS_REVISION= < spirv-headers_revision_android set /p SHADERC_REVISION= < shaderc_revision_android +set /p VULKAN_HEADERS_REVISION= < vulkan-headers_revision_android echo GLSLANG_REVISION=%GLSLANG_REVISION% echo SPIRV_TOOLS_REVISION=%SPIRV_TOOLS_REVISION% echo SPIRV_HEADERS_REVISION=%SPIRV_HEADERS_REVISION% echo SHADERC_REVISION=%SHADERC_REVISION% +echo VULKAN_HEADERS_REVISION=%VULKAN_HEADERS_REVISION% -echo Creating and/or updating glslang, spirv-tools, spirv-headers, shaderc in %BASE_DIR% +echo Creating and/or updating glslang, spirv-tools, spirv-headers, shaderc, vulkan-headers in %BASE_DIR% -set sync-glslang=1 -set sync-spirv-tools=1 -set sync-spirv-headers=1 -set sync-shaderc=1 -set build-shaderc=1 +set sync-glslang=0 +set sync-spirv-tools=0 +set sync-spirv-headers=0 +set sync-shaderc=0 +set sync-vulkan-headers=1 +set build-shaderc=0 if %sync-shaderc% equ 1 ( if not exist %SHADERC_DIR% ( @@ -149,6 +160,16 @@ if %sync-spirv-headers% equ 1 ( if %errorCode% neq 0 (goto:error) ) +if %sync-vulkan-headers% equ 1 ( + if %ERRORLEVEL% neq 0 (goto:error) + if not exist %VULKAN_HEADERS_DIR% ( + call:create_vulkan-headers + ) + if %errorCode% neq 0 (goto:error) + call:update_vulkan-headers + if %errorCode% neq 0 (goto:error) +) + if %build-shaderc% equ 1 ( call:build_shaderc if %errorCode% neq 0 (goto:error) @@ -287,3 +308,28 @@ goto:eof set errorCode=1 ) goto:eof + +:create_vulkan-headers + echo. + echo Creating local vulkan-headers repository %VULKAN_HEADERS_DIR% + if not exist "%VULKAN_HEADERS_DIR%\" mkdir %VULKAN_HEADERS_DIR% + cd %VULKAN_HEADERS_DIR% + git clone https://github.com/KhronosGroup/Vulkan-Headers.git . + git checkout %VULKAN_HEADERS_REVISION% + if not exist %VULKAN_HEADERS_DIR%\registry ( + echo vulkan-headers source download failed! + set errorCode=1 + ) +goto:eof + +:update_vulkan-headers + echo. + echo Updating %VULKAN_HEADERS_DIR% + cd %VULKAN_HEADERS_DIR% + git fetch --all + git checkout %VULKAN_HEADERS_REVISION% + if not exist %VULKAN_HEADERS_DIR%\registry ( + echo vulkan-headers source update failed! + set errorCode=1 + ) +goto:eof diff --git a/build-android/update_external_sources_android.sh b/build-android/update_external_sources_android.sh index 3d55728a..dc20c105 100755 --- a/build-android/update_external_sources_android.sh +++ b/build-android/update_external_sources_android.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Update source for glslang, spirv-tools, shaderc +# Update source for glslang, spirv-tools, shaderc, vulkan-headers # Copyright 2016 The Android Open Source Project # Copyright (C) 2015 Valve Corporation @@ -18,6 +18,12 @@ set -e +sync_glslang=0 +sync_spirv_tools=0 +sync_spirv_headers=0 +sync_shaderc=0 +sync_vulkan_headers=1 + ANDROIDBUILDDIR=$PWD BUILDDIR=$ANDROIDBUILDDIR BASEDIR=$BUILDDIR/third_party @@ -26,21 +32,25 @@ GLSLANG_REVISION=$(cat $ANDROIDBUILDDIR/glslang_revision_android) SPIRV_TOOLS_REVISION=$(cat $ANDROIDBUILDDIR/spirv-tools_revision_android) SPIRV_HEADERS_REVISION=$(cat $ANDROIDBUILDDIR/spirv-headers_revision_android) SHADERC_REVISION=$(cat $ANDROIDBUILDDIR/shaderc_revision_android) +VULKAN_HEADERS_REVISION=$(cat $ANDROIDBUILDDIR/vulkan-headers_revision_android) echo "GLSLANG_REVISION=$GLSLANG_REVISION" echo "SPIRV_TOOLS_REVISION=$SPIRV_TOOLS_REVISION" echo "SPIRV_HEADERS_REVISION=$SPIRV_HEADERS_REVISION" echo "SHADERC_REVISION=$SHADERC_REVISION" +echo "VULKAN_HEADERS_REVISION=$VULKAN_HEADERS_REVISION" GLSLANG_URL=$(cat $ANDROIDBUILDDIR/glslang_url_android) SPIRV_TOOLS_URL=$(cat $ANDROIDBUILDDIR/spirv-tools_url_android) SPIRV_HEADERS_URL=$(cat $ANDROIDBUILDDIR/spirv-headers_url_android) SHADERC_URL=$(cat $ANDROIDBUILDDIR/shaderc_url_android) +VULKAN_HEADERS_URL=$(cat $ANDROIDBUILDDIR/vulkan-headers_url_android) echo "GLSLANG_URL=$GLSLANG_URL" echo "SPIRV_TOOL_URLS_=$SPIRV_TOOLS_URL" echo "SPIRV_HEADERS_URL=$SPIRV_HEADERS_URL" echo "SHADERC_URL=$SHADERC_URL" +echo "VULKAN_HEADERS_URL=$VULKAN_HEADERS_URL" if [[ $(uname) == "Linux" ]]; then cores="$(nproc || echo 4)" @@ -188,25 +198,61 @@ function build_shaderc () { fi } -if [ ! -d "$BASEDIR/shaderc" -o ! -d "$BASEDIR/shaderc/.git" ]; then - create_shaderc +function create_vulkan-headers () { + rm -rf $BASEDIR/Vulkan-Headers + echo "Creating local Vulkan-Headers repository ($BASEDIR/Vulkan-Headers)." + mkdir -p $BASEDIR/Vulkan-Headers + cd $BASEDIR/Vulkan-Headers + git clone $VULKAN_HEADERS_URL . + git checkout $VULKAN_HEADERS_REVISION +} + +function update_vulkan-headers () { + echo "Updating $BASEDIR/Vulkan-Headers" + cd $BASEDIR/Vulkan-Headers + if [[ $(git config --get remote.origin.url) != $VULKAN_HEADERS_URL ]]; then + echo "Vulkan-Headers URL mismatch, recreating local repo" + create_vulkan-headers + return + fi + git fetch --all + git checkout $VULKAN_HEADERS_REVISION +} + +if [ $sync_shaderc -eq 1 ]; then + if [ ! -d "$BASEDIR/shaderc" -o ! -d "$BASEDIR/shaderc/.git" ]; then + create_shaderc + fi + update_shaderc +fi + +if [ $sync_glslang -eq 1 ]; then + if [ ! -d "$BASEDIR/shaderc/third_party/glslang" -o ! -d "$BASEDIR/shaderc/third_party/glslang/.git" -o -d "$BASEDIR/shaderc/third_party/glslang/.svn" ]; then + create_glslang + fi + update_glslang fi -update_shaderc -if [ ! -d "$BASEDIR/shaderc/third_party/glslang" -o ! -d "$BASEDIR/shaderc/third_party/glslang/.git" -o -d "$BASEDIR/shaderc/third_party/glslang/.svn" ]; then - create_glslang +if [ $sync_spirv_tools -eq 1 ]; then + if [ ! -d "$BASEDIR/shaderc/third_party/spirv-tools" -o ! -d "$BASEDIR/shaderc/third_party/spirv-tools/.git" ]; then + create_spirv-tools + fi + update_spirv-tools fi -update_glslang -if [ ! -d "$BASEDIR/shaderc/third_party/spirv-tools" -o ! -d "$BASEDIR/shaderc/third_party/spirv-tools/.git" ]; then - create_spirv-tools +if [ $sync_spirv_headers -eq 1 ]; then + if [ ! -d "$BASEDIR/shaderc/third_party/spirv-tools/external/spirv-headers" -o ! -d "$BASEDIR/shaderc/third_party/spirv-tools/external/spirv-headers/.git" ]; then + create_spirv-headers + fi + update_spirv-headers fi -update_spirv-tools -if [ ! -d "$BASEDIR/shaderc/third_party/spirv-tools/external/spirv-headers" -o ! -d "$BASEDIR/shaderc/third_party/spirv-tools/external/spirv-headers/.git" ]; then - create_spirv-headers +if [ $sync_vulkan_headers -eq 1 ]; then + if [ ! -d "$BASEDIR/Vulkan-Headers" -o ! -d "$BASEDIR/Vulkan-Headers/.git" ]; then + create_vulkan-headers + fi + update_vulkan-headers fi -update_spirv-headers if [[ -z $nobuild ]] then diff --git a/build-android/vulkan-headers_revision_android b/build-android/vulkan-headers_revision_android new file mode 100644 index 00000000..702441ea --- /dev/null +++ b/build-android/vulkan-headers_revision_android @@ -0,0 +1 @@ +afd12b7bdcd63bf4d8d669d6e06a368a0954b6e3 diff --git a/build-android/vulkan-headers_url_android b/build-android/vulkan-headers_url_android new file mode 100644 index 00000000..9ce98515 --- /dev/null +++ b/build-android/vulkan-headers_url_android @@ -0,0 +1 @@ +https://github.com/KhronosGroup/Vulkan-Headers.git diff --git a/cube/android/jni/Android.mk b/cube/android/jni/Android.mk index b814e46a..25828cf9 100644 --- a/cube/android/jni/Android.mk +++ b/cube/android/jni/Android.mk @@ -22,7 +22,7 @@ LOCAL_MODULE := Cube LOCAL_SRC_FILES += $(DEMO_DIR)/cube.c \ $(SRC_DIR)/common/vulkan_wrapper.cpp \ $(SRC_DIR)/common/android_util.cpp -LOCAL_C_INCLUDES += $(SRC_DIR)/Vulkan-Headers/include \ +LOCAL_C_INCLUDES += $(SRC_DIR)/build-android/third_party/Vulkan-Headers/include \ $(DEMO_DIR)/android/include \ $(SRC_DIR)/libs \ $(SRC_DIR)/common \ |