diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fc214ed363..c8615d65d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -77,16 +77,6 @@ jobs: - name: Build and Test VulkanTools run: python3 scripts/github_ci_win.py --config ${{ matrix.config }} --arch ${{ matrix.arch }} - android: - runs-on: ubuntu-22.04 - strategy: - matrix: - abi: [ arm64-v8a , armeabi-v7a ] - steps: - - uses: actions/checkout@v3 - - name: ndk-build - run: python scripts/github_ci_android.py --abi ${{ matrix.abi }} - android-cmake: runs-on: ubuntu-22.04 steps: @@ -109,4 +99,3 @@ jobs: run: cmake --build build - name: Install run: cmake --install build --prefix build/install - \ No newline at end of file diff --git a/BUILD.md b/BUILD.md index d93764a978..f8308b2383 100644 --- a/BUILD.md +++ b/BUILD.md @@ -99,30 +99,6 @@ export PATH=/usr/local/bin:$PATH brew install python python3 git ``` -### Android Additional System Requirements -Install the required tools for Linux and Windows covered above, then add the -following. - -#### Android Studio -- Install 2.1 or later version of [Android Studio](https://developer.android.com/studio) -- From the "Welcome to Android Studio" splash screen, add the following components using Configure > SDK Manager: - - SDK Tools > Android NDK - -#### Add NDK to path - -On Windows: -``` -set PATH=%LOCALAPPDATA%\Android\sdk\ndk-bundle;%PATH% -``` -On Linux: -``` -export PATH=$HOME/Android/Sdk/ndk-bundle:$PATH -``` -On macOS: -``` -export PATH=$HOME/Library/Android/sdk/ndk-bundle:$PATH -``` - ## Getting Started Build Instructions ### 64-bit Windows Build @@ -172,42 +148,8 @@ ctest --parallel 8 --output-on-failure ``` ### Android Build -Use the following to ensure the Android build works. - -#### Android Build from Windows -From Developer Command Prompt for VS2017: -``` -cd build-android -update_external_sources_android.bat -android-generate.bat -ndk-build -``` - -#### Android Build from Linux -From your terminal: -``` -cd build-android -./update_external_sources_android.sh -./android-generate.sh -ndk-build -j $(nproc) -``` -#### Android Build from macOS -From your terminal: -``` -cd build-android -./update_external_sources_android.sh -./android-generate.sh -ndk-build -j $(sysctl -n hw.ncpu) -``` - -#### vkjson_info -Currently vkjson_info is only available as an executable for devices with root access. - -To use, simply push it to the device and run it. The resulting json file will be found in: -``` -/sdcard/Android/.json -``` +TODO: Update android build documentation with new CMake build. ## The VulkanTools repository diff --git a/CMakeLists.txt b/CMakeLists.txt index 134423238e..01372eb9b4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -7,7 +7,16 @@ add_subdirectory(scripts) set(API_NAME "Vulkan" CACHE STRING "API name") add_definitions(-DAPI_NAME="${API_NAME}") -add_definitions(-DVK_ENABLE_BETA_EXTENSIONS) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) +set(CMAKE_CXX_VISIBILITY_PRESET "hidden") +set(CMAKE_VISIBILITY_INLINES_HIDDEN "YES") + +add_compile_definitions(VK_ENABLE_BETA_EXTENSIONS) + +# TODO: Cleanup VK definitions +if (ANDROID) + add_compile_definitions(VK_USE_PLATFORM_ANDROID_KHR) +endif() include(GNUInstallDirs) diff --git a/build-android/AndroidManifest.xml b/build-android/AndroidManifest.xml deleted file mode 100644 index 0f0a5fff7f..0000000000 --- a/build-android/AndroidManifest.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/build-android/android-generate.bat b/build-android/android-generate.bat deleted file mode 100644 index 555e65b5ff..0000000000 --- a/build-android/android-generate.bat +++ /dev/null @@ -1,81 +0,0 @@ -@echo off -REM # Copyright 2015-2019 The Android Open Source Project -REM # Copyright (C) 2015-2019 Valve Corporation -REM # Copyright (C) 2015-2019 LunarG, Inc. -REM -REM # Licensed under the Apache License, Version 2.0 (the "License"); -REM # you may not use this file except in compliance with the License. -REM # You may obtain a copy of the License at -REM -REM # http://www.apache.org/licenses/LICENSE-2.0 -REM -REM # Unless required by applicable law or agreed to in writing, software -REM # distributed under the License is distributed on an "AS IS" BASIS, -REM # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -REM # See the License for the specific language governing permissions and -REM # limitations under the License. - -echo Removing old generated directory in VT\build-android -echo ******** -if exist generated ( - RMDIR /S /Q generated -) - -echo Creating new empty generated directories in VT\build-android -echo ******** -MKDIR generated -MKDIR generated\include -MKDIR generated\common - -echo Setting some environment variables -echo ******** -set LVL_BASE=%~dp0\third_party\Vulkan-ValidationLayers -set LVL_SCRIPTS=%LVL_BASE%\scripts -set VT_SCRIPTS=..\..\..\scripts -set REGISTRY_PATH=%~dp0\third_party\Vulkan-Headers\registry -set REGISTRY=%REGISTRY_PATH%\vk.xml -set VIDEO_REGISTRY=%REGISTRY_PATH%\video.xml - -echo Entering Generated/Include Folder -echo ******** -pushd generated\include - -REM apidump -echo Generating VT apidump header/source files -echo ******** -py -3 %VT_SCRIPTS%\vt_genvk.py -registry %REGISTRY% -scripts %REGISTRY_PATH% api_dump.cpp -py -3 %VT_SCRIPTS%\vt_genvk.py -registry %REGISTRY% -scripts %REGISTRY_PATH% api_dump_text.h -py -3 %VT_SCRIPTS%\vt_genvk.py -registry %REGISTRY% -scripts %REGISTRY_PATH% api_dump_html.h -py -3 %VT_SCRIPTS%\vt_genvk.py -registry %REGISTRY% -scripts %REGISTRY_PATH% api_dump_json.h - - -py -3 %VT_SCRIPTS%\vt_genvk.py -registry %VIDEO_REGISTRY% -scripts %REGISTRY_PATH% api_dump_video_text.h -py -3 %VT_SCRIPTS%\vt_genvk.py -registry %VIDEO_REGISTRY% -scripts %REGISTRY_PATH% api_dump_video_html.h -py -3 %VT_SCRIPTS%\vt_genvk.py -registry %VIDEO_REGISTRY% -scripts %REGISTRY_PATH% api_dump_video_json.h - - -REM Copy over the built source files to LVL. Otherwise, -REM cube won't build. -echo Entering third_party\Vulkan-ValidationLayers\build-android -echo ******** -pushd %LVL_BASE%\build-android -REM Removing old generated directory in third_party\Vulkan-ValidationLayers\build-android -if exist generated ( - RMDIR /S /Q generated -) -REM Creating new empty generated directories in third_party\Vulkan-ValidationLayers\build-android -MKDIR generated -MKDIR generated\include -MKDIR generated\common - -echo Leaving third_party\Vulkan-ValidationLayers\build-android -echo ******** -popd - -echo Copying generated headers/source into third_party\Vulkan-ValidationLayers\build-android -echo ******** -COPY /Y * %LVL_BASE%\build-android\generated\include - -echo leaving Generated/Include Folder -echo ******** -popd diff --git a/build-android/android-generate.sh b/build-android/android-generate.sh deleted file mode 100755 index f49adcb919..0000000000 --- a/build-android/android-generate.sh +++ /dev/null @@ -1,61 +0,0 @@ -#!/bin/bash - -# Copyright 2015 The Android Open Source Project -# Copyright (C) 2015 Valve Corporation - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -dir=$(cd -P -- "$(dirname -- "$0")" && pwd -P) -cd $dir - -rm -rf generated -mkdir -p generated/include generated/common - -LVL_BASE=$dir/third_party/Vulkan-ValidationLayers -LVL_SCRIPTS=${LVL_BASE}/scripts -LVL_GENERATED=${LVL_BASE}/layers/vulkan/generated -VT_SCRIPTS=../../../scripts -REGISTRY_PATH=$dir/third_party/Vulkan-Headers/registry -REGISTRY=${REGISTRY_PATH}/vk.xml -VIDEO_REGISTRY=${REGISTRY_PATH}/video.xml - -# Check for python 3.6 or greater -PYTHON_EXECUTABLE=python3 -PYTHON_MINOR_VERSION=$($PYTHON_EXECUTABLE --version | cut -d. -f2) -if [ $PYTHON_MINOR_VERSION -lt "6" ]; then - for MINOR_TEST in {6..20} - do - TEST_EXECUTABLE=$PYTHON_EXECUTABLE.$MINOR_TEST - if which $TEST_EXECUTABLE; then - PYTHON_EXECUTABLE=$TEST_EXECUTABLE - break - fi - done -fi -echo "Using python: $(which $PYTHON_EXECUTABLE)" - - -# apidump -( cd generated/include; ${PYTHON_EXECUTABLE} ${VT_SCRIPTS}/vt_genvk.py -registry ${REGISTRY} -scripts ${REGISTRY_PATH} api_dump.cpp) -( cd generated/include; ${PYTHON_EXECUTABLE} ${VT_SCRIPTS}/vt_genvk.py -registry ${REGISTRY} -scripts ${REGISTRY_PATH} api_dump_text.h) -( cd generated/include; ${PYTHON_EXECUTABLE} ${VT_SCRIPTS}/vt_genvk.py -registry ${REGISTRY} -scripts ${REGISTRY_PATH} api_dump_html.h) -( cd generated/include; ${PYTHON_EXECUTABLE} ${VT_SCRIPTS}/vt_genvk.py -registry ${REGISTRY} -scripts ${REGISTRY_PATH} api_dump_json.h) - -( cd generated/include; ${PYTHON_EXECUTABLE} ${VT_SCRIPTS}/vt_genvk.py -registry ${VIDEO_REGISTRY} -scripts ${REGISTRY_PATH} api_dump_video_text.h) -( cd generated/include; ${PYTHON_EXECUTABLE} ${VT_SCRIPTS}/vt_genvk.py -registry ${VIDEO_REGISTRY} -scripts ${REGISTRY_PATH} api_dump_video_html.h) -( cd generated/include; ${PYTHON_EXECUTABLE} ${VT_SCRIPTS}/vt_genvk.py -registry ${VIDEO_REGISTRY} -scripts ${REGISTRY_PATH} api_dump_video_json.h) - -( pushd ${LVL_BASE}/build-android; rm -rf generated; mkdir -p generated/include generated/common; popd ) -( cd generated/include; cp -rf * ${LVL_BASE}/build-android/generated/include ) - -exit 0 diff --git a/build-android/build_all.sh b/build-android/build_all.sh deleted file mode 100755 index 7eb2d90252..0000000000 --- a/build-android/build_all.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/bash - -# Copyright 2017 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -if [ -z "${ANDROID_SDK_HOME}" ]; -then echo "Please set ANDROID_SDK_HOME, exiting"; exit 1; -else echo "ANDROID_SDK_HOME is ${ANDROID_SDK_HOME}"; -fi - -if [ -z "${ANDROID_NDK_HOME}" ]; -then echo "Please set ANDROID_NDK_HOME, exiting"; exit 1; -else echo "ANDROID_NDK_HOME is ${ANDROID_NDK_HOME}"; -fi - -if [[ $(uname) == "Linux" ]]; then - cores=$(nproc) || echo 4 -elif [[ $(uname) == "Darwin" ]]; then - cores=$(sysctl -n hw.ncpu) || echo 4 -fi -use_cores=${VT_BUILD_CORES:-$cores} - -function findtool() { - if [[ ! $(type -t $1) ]]; then - echo Command $1 not found, see ../BUILD.md; - exit 1; - fi -} - -# Check for dependencies -findtool aapt -findtool zipalign -findtool apksigner - -set -ev - -LAYER_BUILD_DIR=$PWD -CUBE_BUILD_DIR=$PWD/third_party/Vulkan-Tools/cube/android -echo LAYER_BUILD_DIR="${LAYER_BUILD_DIR}" -echo CUBE_BUILD_DIR="${CUBE_BUILD_DIR}" - -function create_APK() { - aapt package -f -M AndroidManifest.xml -I "$ANDROID_SDK_HOME/platforms/android-26/android.jar" -S res -F bin/$1-unaligned.apk bin/libs - # update this logic to detect if key is already there. If so, use it, otherwise create it. - zipalign -f 4 bin/$1-unaligned.apk bin/$1.apk - apksigner sign --verbose --ks ~/.android/debug.keystore --ks-pass pass:android bin/$1.apk -} - -# -# Init base submodules -# -(pushd ..; git submodule update --init --recursive; popd) - -# -# build layers -# -./update_external_sources_android.sh --no-build -./android-generate.sh -ndk-build -j $use_cores -l $use_cores - -# -# build VulkanLayerValidationTests APK -# -mkdir -p bin/libs/lib -cp -r $LAYER_BUILD_DIR/libs/* $LAYER_BUILD_DIR/bin/libs/lib/ -create_APK VulkanLayerValidationTests - -# -# build vkcube APKs (with and without layers) -# -( -pushd $CUBE_BUILD_DIR -ndk-build -j $cores -# Package one APK without validation layers -mkdir -p $CUBE_BUILD_DIR/cube/bin/libs/lib -cp -r $CUBE_BUILD_DIR/libs/* $CUBE_BUILD_DIR/cube/bin/libs/lib/ -cd $CUBE_BUILD_DIR/cube -create_APK vkcube -# And one with validation layers -mkdir -p $CUBE_BUILD_DIR/cube-with-layers/bin/libs/lib -cp -r $CUBE_BUILD_DIR/libs/* $CUBE_BUILD_DIR/cube-with-layers/bin/libs/lib/ -cp -r $LAYER_BUILD_DIR/libs/* $CUBE_BUILD_DIR/cube-with-layers/bin/libs/lib/ -cd $CUBE_BUILD_DIR/cube-with-layers -create_APK vkcube-with-layers -popd -) - -# -# build Smoke with layers -# -# TODO - -echo Builds succeeded -exit 0 diff --git a/build-android/install_all.sh b/build-android/install_all.sh deleted file mode 100755 index 2e404acead..0000000000 --- a/build-android/install_all.sh +++ /dev/null @@ -1,80 +0,0 @@ -#!/bin/bash - -# Copyright 2017 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -e - -# -# Parse parameters -# - -function printUsage { - echo "Supported parameters are:" - echo " -s|--serial (optional)" - echo - echo "i.e. ${0##*/} -s " - 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 - -s|--serial) - # include the flag, because we need to leave it off if not provided - serial="$2" - shift 2 - ;; - -*) - # unknown option - echo Unknown option: $1 - echo - printUsage - exit 1 - ;; - esac -done - -if [[ $serial ]]; then - echo serial = "${serial}" - serialFlag="-s $serial" - if [[ $(adb devices) != *"$serial"* ]] - then - echo Device not found: "${serial}" - echo - printUsage - exit 1 - fi -else - echo Using device $(adb get-serialno) -fi - -# Install everything built by build_all.sh -echo "adb $serialFlag install -r bin/VulkanLayerValidationTests.apk" -adb $serialFlag install -r bin/VulkanLayerValidationTests.apk -echo "adb $serialFlag install -r ../submodules/Vulkan-Tools/cube/android/cube/bin/vkcube.apk" -adb $serialFlag install -r ../submodules/Vulkan-Tools/cube/android/cube/bin/vkcube.apk -echo "adb $serialFlag install -r ../submodules/Vulkan-Tools/cube/android/cube-with-layers/bin/vkcube-with-layers.apk" -adb $serialFlag install -r ../submodules/Vulkan-Tools/cube/android/cube-with-layers/bin/vkcube-with-layers.apk - -exit $? diff --git a/build-android/jni/Android.mk b/build-android/jni/Android.mk deleted file mode 100644 index 4a89374b3b..0000000000 --- a/build-android/jni/Android.mk +++ /dev/null @@ -1,76 +0,0 @@ -# Copyright 2015-2019 The Android Open Source Project -# Copyright (C) 2015-2019 Valve Corporation -# Copyright (C) 2015-2019 LunarG, Inc. - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -LOCAL_PATH := $(call my-dir) -SRC_DIR := ../.. -LAYER_DIR := ../generated -THIRD_PARTY := ../third_party -LVL_DIR := $(THIRD_PARTY)/Vulkan-ValidationLayers -ANDROID_DIR := $(SRC_DIR)/build-android - -include $(CLEAR_VARS) -LOCAL_MODULE := layer_utils -LOCAL_SRC_FILES += $(LVL_DIR)/layers/vk_layer_config.cpp -LOCAL_SRC_FILES += $(LVL_DIR)/layers/utils/vk_layer_extension_utils.cpp -LOCAL_SRC_FILES += $(LVL_DIR)/layers/error_message/logging.cpp -LOCAL_SRC_FILES += $(LVL_DIR)/layers/utils/vk_layer_utils.cpp -LOCAL_SRC_FILES += $(LVL_DIR)/layers/vulkan/generated/vk_format_utils.cpp -LOCAL_SRC_FILES += $(SRC_DIR)/vku/vk_layer_settings.cpp -LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(THIRD_PARTY)/Vulkan-Headers/include \ - $(SRC_DIR)/vku \ - $(LOCAL_PATH)/$(LAYER_DIR)/include \ - $(LOCAL_PATH)/$(LVL_DIR)/layers \ - $(LOCAL_PATH)/$(LVL_DIR)/layers/vulkan \ - $(LOCAL_PATH)/$(LVL_DIR)/layers/vulkan/generated -LOCAL_CPPFLAGS += -std=c++17 -Wall -Werror -Wno-unused-function -Wno-unused-const-variable -LOCAL_CPPFLAGS += -DVK_ENABLE_BETA_EXTENSIONS -DVK_USE_PLATFORM_ANDROID_KHR -DVK_PROTOTYPES -fvisibility=hidden -include $(BUILD_STATIC_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := VkLayer_api_dump -LOCAL_SRC_FILES += $(LAYER_DIR)/include/api_dump.cpp -LOCAL_SRC_FILES += $(SRC_DIR)/layersvt/vk_layer_table.cpp -LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(THIRD_PARTY)/Vulkan-Headers/include \ - $(LOCAL_PATH)/$(LVL_DIR)/layers \ - $(LOCAL_PATH)/$(LVL_DIR)/layers/vulkan \ - $(LOCAL_PATH)/$(LVL_DIR)/layers/vulkan/generated \ - $(LOCAL_PATH)/$(SRC_DIR)/layersvt \ - $(LOCAL_PATH)/$(LAYER_DIR)/include -LOCAL_STATIC_LIBRARIES += layer_utils -LOCAL_CPPFLAGS += -std=c++17 -Wall -Werror -Wno-unused-function -Wno-unused-const-variable -mxgot -LOCAL_CPPFLAGS += -DVK_ENABLE_BETA_EXTENSIONS -DVK_USE_PLATFORM_ANDROID_KHR -DVK_PROTOTYPES -fvisibility=hidden -LOCAL_LDLIBS := -llog -include $(BUILD_SHARED_LIBRARY) - -include $(CLEAR_VARS) -LOCAL_MODULE := VkLayer_screenshot -LOCAL_SRC_FILES += $(SRC_DIR)/layersvt/screenshot.cpp -LOCAL_SRC_FILES += $(SRC_DIR)/layersvt/screenshot_parsing.cpp -LOCAL_SRC_FILES += $(SRC_DIR)/layersvt/vk_layer_table.cpp -LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(THIRD_PARTY)/Vulkan-Headers/include \ - $(LOCAL_PATH)/$(LVL_DIR)/layers \ - $(LOCAL_PATH)/$(LVL_DIR)/layers/vulkan \ - $(LOCAL_PATH)/$(LVL_DIR)/layers/vulkan/generated \ - $(LOCAL_PATH)/$(SRC_DIR)/layersvt \ - $(LOCAL_PATH)/$(LAYER_DIR)/include -LOCAL_STATIC_LIBRARIES += layer_utils -LOCAL_CPPFLAGS += -std=c++17 -Wall -Werror -Wno-unused-function -Wno-unused-const-variable -mxgot -LOCAL_CPPFLAGS += -DVK_ENABLE_BETA_EXTENSIONS -DVK_USE_PLATFORM_ANDROID_KHR -DVK_PROTOTYPES -fvisibility=hidden -LOCAL_LDLIBS := -llog -include $(BUILD_SHARED_LIBRARY) - -$(call import-module,android/native_app_glue) -$(call import-module,third_party/googletest) diff --git a/build-android/jni/Application.mk b/build-android/jni/Application.mk deleted file mode 100644 index 8e0cf7b8e9..0000000000 --- a/build-android/jni/Application.mk +++ /dev/null @@ -1,20 +0,0 @@ -# Copyright 2015 The Android Open Source Project -# Copyright (C) 2015 Valve Corporation - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at - -# http://www.apache.org/licenses/LICENSE-2.0 - -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -APP_ABI := armeabi-v7a arm64-v8a x86 x86_64 -APP_PLATFORM := android-26 -APP_STL := c++_static -NDK_TOOLCHAIN_VERSION := clang -NDK_MODULE_PATH := . diff --git a/build-android/jni/shaderc/Application.mk b/build-android/jni/shaderc/Application.mk deleted file mode 100644 index 5447415eb5..0000000000 --- a/build-android/jni/shaderc/Application.mk +++ /dev/null @@ -1,4 +0,0 @@ -APP_ABI := all -APP_BUILD_SCRIPT := Android.mk -APP_STL := c++_static -APP_PLATFORM := android-23 diff --git a/build-android/res/values/strings.xml b/build-android/res/values/strings.xml deleted file mode 100644 index 8ff71b0503..0000000000 --- a/build-android/res/values/strings.xml +++ /dev/null @@ -1,24 +0,0 @@ - - - - - - - - VulkanLayerValidationTests - - diff --git a/build-android/test_APK.sh b/build-android/test_APK.sh deleted file mode 100755 index 801b16fa85..0000000000 --- a/build-android/test_APK.sh +++ /dev/null @@ -1,239 +0,0 @@ -#!/bin/bash - -# Copyright 2017 The Android Open Source Project -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -# -# Parse parameters -# - -function printUsage { - echo "Supported parameters are:" - echo " -p|--platform (optional)" - echo " -f|--filter (optional)" - echo " -s|--serial (optional)" - echo - echo "i.e. ${0##*/} -p -f -s " - 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 - -p|--platform) - platform="$2" - shift 2 - ;; - -f|--filter) - filter="$2" - shift 2 - ;; - -s|--serial) - serial="$2" - shift 2 - ;; - -*) - # unknown option - echo Unknown option: $1 - echo - printUsage - exit 1 - ;; - esac -done - -if [[ $serial ]]; then - serialFlag="-s $serial" - if [[ $(adb devices) != *"$serial"* ]] - then - echo Device not found: "${serial}" - echo - printUsage - exit 1 - fi -else - echo Using device $(adb get-serialno) -fi - -if [[ -z $platform ]] -then - echo No platform specified. - platform="UnspecifiedPlatform" -fi - -if [[ -z $filter ]] -then - echo No filter specified, running all tests. - filter="*" -fi - -if [[ $platform ]]; then echo platform = "${platform}"; fi -if [[ $filter ]]; then echo filter = "${filter}"; fi -if [[ $serial ]]; then echo serial = "${serial}"; fi - -set -ev - -# -# Start up -# - -# Wake up the device -adb $serialFlag shell input keyevent "KEYCODE_MENU" -adb $serialFlag shell input keyevent "KEYCODE_HOME" - -# Grab our Android test mutex -# Wait for any existing test runs on the devices - -# Blow away the lock if tests run too long, avoiding infinite loop -lock_seconds=1200 # Duration in seconds. -lock_end_time=$(( $(date +%s) + lock_seconds )) # Calculate end time. - -until mkdir /var/tmp/VkLayerValidationTests.$serial.lock -do - sleep 5 - echo "Waiting for existing Android test to complete on $serial" - - if [ $(date +%s) -gt $lock_end_time ] - then - echo "Lock timeout reached: $lock_seconds seconds" - echo "Deleting /var/tmp/VkLayerValidationTests.$serial.lock" - rm -r /var/tmp/VkLayerValidationTests.$serial.lock - fi -done - -# Clean up our lock on any exit condition -function finish { - rm -r /var/tmp/VkLayerValidationTests.$serial.lock -} -trap finish EXIT - -# Clear the log -adb $serialFlag logcat -c - -# Ensure any previous activity has stopped, otherwise it won't run tests -adb $serialFlag shell am force-stop com.example.VulkanLayerValidationTests - -# Remove any existing APK that may have been installed from another host -# Disable exit on error in case the APK is not present -set +e -adb $serialFlag shell pm list packages | grep com.example.VulkanLayerValidationTests -if [ $? -eq 0 ] -then - adb $serialFlag uninstall com.example.VulkanLayerValidationTests -fi -# Re-enable exit on error -set -e - -# Install the current build -adb $serialFlag install -r bin/VulkanLayerValidationTests.apk - -# Kick off the tests with known expection list -adb $serialFlag shell am start -a android.intent.action.MAIN -c android-intent.category.LAUNCH -n com.example.VulkanLayerValidationTests/android.app.NativeActivity --es args --gtest_filter="${filter}" - -# -# Scrape the log until we get pass/fail/crash -# - -# The following loop will give tests 20 minutes to pass/fail/crash -seconds=1200 # Duration in seconds. -endTime=$(( $(date +%s) + seconds )) # Calculate end time. - -exitCode=-1; - -# Disable exit on error, we expect grep to fail multiple times in this loop -set +e - -while [ $(date +%s) -lt $endTime ]; do # Loop until interval has elapsed. - - # The following line is printed from android_main on success - adb $serialFlag logcat -d | grep "==== Tests PASSED ====" - if [ $? -eq 0 ] - then - echo VulkanLayerValidationTests PASSED! - exitCode=0 - break - fi - - # The following line is printed from android_main on failure - adb $serialFlag logcat -d | grep "==== Tests FAILED ====" - if [ $? -eq 0 ] - then - echo VulkanLayerValidationTests FAILED! - exitCode=1 - break - fi - - # developer.android.com recommends searching for the following string to detect native crash - adb $serialFlag logcat -d | grep "\*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\* \*\*\*" - if [ $? -eq 0 ] - then - exitCode=2 - echo VulkanLayerValidationTests CRASHED! - break - fi - - sleep 5 - -done - -# Re-enable exit on error -set -e - -if [ $exitCode -eq -1 ] -then - echo "VulkanLayerValidationTests hasn't completed in $seconds seconds. Script exiting." -fi - -# -# Cleanup -# - -# Return to home screen to clear any error pop-ups -adb $serialFlag shell input keyevent "KEYCODE_HOME" - -# Stop the activity -adb $serialFlag shell am force-stop com.example.VulkanLayerValidationTests - -today=$(date +%Y-%m-%d.%H:%M:%S) -outFile="VulkanLayerValidationTests.$platform.$today.out.txt" -errFile="VulkanLayerValidationTests.$platform.$today.err.txt" -adb $serialFlag pull /sdcard/Android/data/com.example.VulkanLayerValidationTests/files/out.txt VulkanLayerValidationTests.$platform.$today.out.txt -adb $serialFlag pull /sdcard/Android/data/com.example.VulkanLayerValidationTests/files/err.txt VulkanLayerValidationTests.$platform.$today.err.txt - -if [ -f $outFile ]; then - echo $outFile size $(wc -c < $outFile) -fi - -if [ -f $errFile ]; then - echo $errFile size $(wc -c < $errFile) -fi - -echo -echo ===== Dumping logcat of VulkanLayerValidationTests ===== -echo If the test is crashing, be sure to inspect full log for complete stack trace. -echo "adb $serialFlag logcat -d | grep VulkanLayerValidationTests" -echo ======================================================== -echo -adb $serialFlag logcat -d | grep VulkanLayerValidationTests - -exit $exitCode diff --git a/build-android/update_external_sources_android.bat b/build-android/update_external_sources_android.bat deleted file mode 100755 index 4b16be8312..0000000000 --- a/build-android/update_external_sources_android.bat +++ /dev/null @@ -1,223 +0,0 @@ -@echo off -REM Update source for Vulkan-Headers, Vulkan-Tools, and Vulkan-ValidationLayers - -REM -REM Copyright 2016-2019 The Android Open Source Project -REM Copyright (C) 2015-2019 Valve Corporation -REM Copyright (C) 2015-2019 LunarG, Inc. -REM -REM Licensed under the Apache License, Version 2.0 (the "License"); -REM you may not use this file except in compliance with the License. -REM You may obtain a copy of the License at -REM -REM http://www.apache.org/licenses/LICENSE-2.0 -REM -REM Unless required by applicable law or agreed to in writing, software -REM distributed under the License is distributed on an "AS IS" BASIS, -REM WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -REM See the License for the specific language governing permissions and -REM limitations under the License. -REM - -setlocal EnableDelayedExpansion -set errorCode=0 -set ANDROID_BUILD_DIR=%~dp0 -set BUILD_DIR=%ANDROID_BUILD_DIR% -set BASE_DIR=%BUILD_DIR%\third_party -set VULKAN_TOOLS_DIR=%BASE_DIR%\Vulkan-Tools -set VULKAN_HEADERS_DIR=%BASE_DIR%\Vulkan-Headers -set VULKAN_VALIDATIONLAYERS_DIR=%BASE_DIR%\Vulkan-ValidationLayers - -for %%X in (where.exe) do (set FOUND=%%~$PATH:X) -if not defined FOUND ( - echo Dependency check failed: - echo where.exe not found - echo This script requires Windows Vista or later, which includes where.exe. - set errorCode=1 -) - -where /q git.exe -if %ERRORLEVEL% equ 1 ( - echo Dependency check failed: - echo git.exe not found - echo Git for Windows can be downloaded here: https://git-scm.com/download/win - echo Install and ensure git.exe makes it into your PATH - set errorCode=1 -) - -where /q ndk-build.cmd -if %ERRORLEVEL% equ 1 ( - echo Dependency check failed: - echo ndk-build.cmd not found - echo Android NDK can be downloaded here: http://developer.android.com/ndk/guides/setup.html - echo Install and ensure ndk-build.cmd makes it into your PATH - set errorCode=1 -) - -REM ensure where is working with below false test -REM where /q foo -REM if %ERRORLEVEL% equ 1 ( -REM echo foo -REM ) - -:main - -if %errorCode% neq 0 (goto:error) - -REM Read the target versions from external file, which is shared with Linux script - -if not exist %ANDROID_BUILD_DIR%\vulkan-tools_revision_android ( - echo. - echo Missing vulkan-tools_revision_android file. Place it in %ANDROID_BUILD_DIR% - set errorCode=1 - goto:error -) - -if not exist %ANDROID_BUILD_DIR%\vulkan-validationlayers_revision_android ( - echo. - echo Missing vulkan-validationlayers_revision_android file. Place it in %ANDROID_BUILD_DIR% - set errorCode=1 - goto:error -) - -set /p VULKAN_TOOLS_REVISION= < vulkan-tools_revision_android -set /p VULKAN_VALIDATIONLAYERS_REVISION= < vulkan-validationlayers_revision_android -set /p VULKAN_HEADERS_REVISION= < vulkan-headers_revision_android -echo VULKAN_TOOLS_REVISION=%VULKAN_TOOLS_REVISION% -echo VULKAN_VALIDATIONLAYERS_REVISION=%VULKAN_VALIDATIONLAYERS_REVISION% -echo VULKAN_HEADERS_REVISION=%VULKAN_HEADERS_REVISION% - -echo Creating and/or updating vulkan-tools, vulkan-validationlayers in %BASE_DIR% - -set sync-vulkan-headers=1 -set sync-vulkan-tools=1 -set sync-vulkan-validationlayers=1 - -REM Always init the submodules, which includes vulkan headers -echo Initializing submodules -git submodule update --init --recursive - -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 %sync-vulkan-tools% equ 1 ( - if %ERRORLEVEL% neq 0 (goto:error) - if not exist %VULKAN_TOOLS_DIR% ( - call:create_vulkan-tools - ) - if %errorCode% neq 0 (goto:error) - call:update_vulkan-tools - if %errorCode% neq 0 (goto:error) -) - -if %sync-vulkan-validationlayers% equ 1 ( - if %ERRORLEVEL% neq 0 (goto:error) - if not exist %VULKAN_VALIDATIONLAYERS_DIR% ( - call:create_vulkan-validationlayers - ) - if %errorCode% neq 0 (goto:error) - call:update_vulkan-validationlayers - if %errorCode% neq 0 (goto:error) -) - -echo. -echo Exiting -goto:finish - -:error -echo. -echo Halting due to error -goto:finish - -:finish -if not "%cd%\" == "%BUILD_DIR%" ( cd %BUILD_DIR% ) -endlocal -REM This needs a fix to return error, something like exit %errorCode% -REM Right now it is returning 0 -goto:eof - - - -REM // ======== Functions ======== // - -: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 - -:create_vulkan-tools - echo. - echo Creating local vulkan-tools repository %VULKAN_TOOLS_DIR% - if not exist "%VULKAN_TOOLS_DIR%\" mkdir %VULKAN_TOOLS_DIR% - cd %VULKAN_TOOLS_DIR% - git clone https://github.com/KhronosGroup/Vulkan-Tools.git . - git checkout %VULKAN_TOOLS_REVISION% - if not exist %VULKAN_TOOLS_DIR%\common ( - echo vulkan-tools source download failed! - set errorCode=1 - ) -goto:eof - -:update_vulkan-tools - echo. - echo Updating %VULKAN_TOOLS_DIR% - cd %VULKAN_TOOLS_DIR% - git fetch --all - git checkout %VULKAN_TOOLS_REVISION% - if not exist %VULKAN_TOOLS_DIR%\common ( - echo vulkan-tools source update failed! - set errorCode=1 - ) -goto:eof - -:create_vulkan-validationlayers - echo. - echo Creating local vulkan-validationlayers repository %VULKAN_VALIDATIONLAYERS_DIR% - if not exist "%VULKAN_VALIDATIONLAYERS_DIR%\" mkdir %VULKAN_VALIDATIONLAYERS_DIR% - cd %VULKAN_VALIDATIONLAYERS_DIR% - git clone https://github.com/KhronosGroup/Vulkan-ValidationLayers.git . - git checkout %VULKAN_VALIDATIONLAYERS_REVISION% - if not exist %VULKAN_VALIDATIONLAYERS_DIR% ( - echo vulkan-validationlayers source download failed! - set errorCode=1 - ) -goto:eof - -:update_vulkan-validationlayers - echo. - echo Updating %VULKAN_VALIDATIONLAYERS_DIR% - cd %VULKAN_VALIDATIONLAYERS_DIR% - git fetch --all - git checkout %VULKAN_VALIDATIONLAYERS_REVISION% - if not exist %VULKAN_VALIDATIONLAYERS_DIR% ( - echo vulkan-validationlayers 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 deleted file mode 100755 index e863c30faa..0000000000 --- a/build-android/update_external_sources_android.sh +++ /dev/null @@ -1,184 +0,0 @@ -#!/bin/bash -# Update source for Vulkan-Headers, Vulkan-Tools, and Vulkan-ValidationLayers - -# Copyright 2016 The Android Open Source Project -# Copyright (C) 2015 Valve Corporation -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -e - -ANDROIDBUILDDIR=$PWD -BUILDDIR=$ANDROIDBUILDDIR -BASEDIR=$BUILDDIR/third_party - -VULKAN_TOOLS_REVISION=$(cat $ANDROIDBUILDDIR/vulkan-tools_revision_android) -VULKAN_HEADERS_REVISION=$(cat $ANDROIDBUILDDIR/vulkan-headers_revision_android) -VULKAN_VALIDATIONLAYERS_REVISION=$(cat $ANDROIDBUILDDIR/vulkan-validationlayers_revision_android) - -echo "VULKAN_TOOLS_REVISION=$VULKAN_TOOLS_REVISION" -echo "VULKAN_HEADERS_REVISION=$VULKAN_HEADERS_REVISION" -echo "VULKAN_VALIDATIONLAYERS_REVISION=$VULKAN_VALIDATIONLAYERS_REVISION" - -VULKAN_TOOLS_URL=$(cat $ANDROIDBUILDDIR/vulkan-tools_url_android) -VULKAN_HEADERS_URL=$(cat $ANDROIDBUILDDIR/vulkan-headers_url_android) -VULKAN_VALIDATIONLAYERS_URL=$(cat $ANDROIDBUILDDIR/vulkan-validationlayers_url_android) - -echo "VULKAN_TOOLS_URL=$VULKAN_TOOLS_URL" -echo "VULKAN_HEADERS_URL=$VULKAN_HEADERS_URL" - -if [[ $(uname) == "Linux" ]]; then - cores="$(nproc || echo 4)" -elif [[ $(uname) == "Darwin" ]]; then - cores=$(sysctl -n hw.ncpu) -fi - -# -# Parse parameters -# - -function printUsage { - echo "Supported parameters are:" - echo " --abi (optional)" - echo " --no-build (optional)" - echo - echo "i.e. ${0##*/} --abi arm64-v8a \\" - exit 1 -} - -while [[ $# -gt 0 ]] -do - case $1 in - --abi) - abi="$2" - shift 2 - ;; - --no-build) - nobuild=1 - shift 1 - ;; - *) - # 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 - -echo no-build=$nobuild -if [[ $nobuild ]] -then - echo Skipping build. -fi - -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 -} - -function create_vulkan-tools () { - rm -rf $BASEDIR/Vulkan-Tools - echo "Creating local Vulkan-Tools repository ($BASEDIR/Vulkan-Tools)." - mkdir -p $BASEDIR/Vulkan-Tools - cd $BASEDIR/Vulkan-Tools - git clone $VULKAN_TOOLS_URL . - git checkout $VULKAN_TOOLS_REVISION - cd build-android - ./update_external_sources_android.sh --no-build -} - -function update_vulkan-tools () { - echo "Updating $BASEDIR/Vulkan-Tools" - cd $BASEDIR/Vulkan-Tools - if [[ $(git config --get remote.origin.url) != $VULKAN_TOOLS_URL ]]; then - echo "Vulkan-Tools URL mismatch, recreating local repo" - create_vulkan-tools - return - fi - git fetch --all - git checkout $VULKAN_TOOLS_REVISION - cd build-android - ./update_external_sources_android.sh --no-build -} - -function create_vulkan-validationlayers () { - rm -rf $BASEDIR/Vulkan-ValidationLayers - echo "Creating local Vulkan-ValidationLayers repository ($BASEDIR/Vulkan-ValidationLayers)." - mkdir -p $BASEDIR/Vulkan-ValidationLayers - cd $BASEDIR/Vulkan-ValidationLayers - git clone $VULKAN_VALIDATIONLAYERS_URL . - git checkout $VULKAN_VALIDATIONLAYERS_REVISION - cd build-android - ./update_external_sources_android.sh --no-build -} - -function update_vulkan-validationlayers () { - echo "Updating $BASEDIR/Vulkan-ValidationLayers" - cd $BASEDIR/Vulkan-ValidationLayers - if [[ $(git config --get remote.origin.url) != $VULKAN_VALIDATIONLAYERS_URL ]]; then - echo "Vulkan-ValidationLayers URL mismatch, recreating local repo" - create_vulkan-tools - return - fi - git fetch --all - git checkout $VULKAN_VALIDATIONLAYERS_REVISION - cd build-android - ./update_external_sources_android.sh --no-build -} - -# Always init the submodules, which includes vulkan headers -echo "Initializing submodules" -git submodule update --init --recursive - -if [ ! -d "$BASEDIR/Vulkan-Headers" -o ! -d "$BASEDIR/Vulkan-Headers/.git" ]; then - create_vulkan-headers -fi -update_vulkan-headers - -if [ ! -d "$BASEDIR/Vulkan-Tools" -o ! -d "$BASEDIR/Vulkan-Tools/.git" ]; then - create_vulkan-tools -fi -update_vulkan-tools - -if [ ! -d "$BASEDIR/Vulkan-ValidationLayers" -o ! -d "$BASEDIR/Vulkan-ValidationLayers/.git" ]; then - create_vulkan-validationlayers -fi -update_vulkan-validationlayers - -echo "" -echo "${0##*/} finished." - diff --git a/build-android/vulkan-headers_revision_android b/build-android/vulkan-headers_revision_android deleted file mode 100644 index e00e07ecbd..0000000000 --- a/build-android/vulkan-headers_revision_android +++ /dev/null @@ -1 +0,0 @@ -v1.3.257 diff --git a/build-android/vulkan-headers_url_android b/build-android/vulkan-headers_url_android deleted file mode 100644 index 9ce9851539..0000000000 --- a/build-android/vulkan-headers_url_android +++ /dev/null @@ -1 +0,0 @@ -https://github.com/KhronosGroup/Vulkan-Headers.git diff --git a/build-android/vulkan-tools_revision_android b/build-android/vulkan-tools_revision_android deleted file mode 100644 index e00e07ecbd..0000000000 --- a/build-android/vulkan-tools_revision_android +++ /dev/null @@ -1 +0,0 @@ -v1.3.257 diff --git a/build-android/vulkan-tools_url_android b/build-android/vulkan-tools_url_android deleted file mode 100644 index a333d31b47..0000000000 --- a/build-android/vulkan-tools_url_android +++ /dev/null @@ -1 +0,0 @@ -https://github.com/KhronosGroup/Vulkan-Tools.git diff --git a/build-android/vulkan-validationlayers_revision_android b/build-android/vulkan-validationlayers_revision_android deleted file mode 100644 index e00e07ecbd..0000000000 --- a/build-android/vulkan-validationlayers_revision_android +++ /dev/null @@ -1 +0,0 @@ -v1.3.257 diff --git a/build-android/vulkan-validationlayers_url_android b/build-android/vulkan-validationlayers_url_android deleted file mode 100644 index 7fd7fccc62..0000000000 --- a/build-android/vulkan-validationlayers_url_android +++ /dev/null @@ -1 +0,0 @@ -https://github.com/KhronosGroup/Vulkan-ValidationLayers.git diff --git a/layersvt/CMakeLists.txt b/layersvt/CMakeLists.txt index b5edfe7da8..50d075a1ae 100644 --- a/layersvt/CMakeLists.txt +++ b/layersvt/CMakeLists.txt @@ -38,8 +38,6 @@ else() message(FATAL_ERROR "Unsupported Platform!") endif() -add_definitions(-DVK_ENABLE_BETA_EXTENSIONS) - if (BUILD_APIDUMP) add_custom_target( generate_api_cpp DEPENDS api_dump.cpp ) add_custom_target( generate_api_text_h DEPENDS api_dump_text.h ) diff --git a/scripts/github_ci_android.py b/scripts/github_ci_android.py deleted file mode 100644 index 5127af4cb4..0000000000 --- a/scripts/github_ci_android.py +++ /dev/null @@ -1,97 +0,0 @@ -#!/usr/bin/env python3 -# Copyright (c) 2021-2023 Valve Corporation -# Copyright (c) 2021-2023 LunarG, Inc. - -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# -# Author: Mark Lobodzinski -# Author: Tony Barbour - -import os -import argparse -import shutil -import subprocess -import sys -import platform - -from argparse import RawDescriptionHelpFormatter - -PROJECT_ROOT = os.path.abspath(os.path.join(os.path.split(os.path.abspath(__file__))[0], '..')) - -if sys.version_info[0] != 3: - print("This script requires Python 3. Run script with [-h] option for more details.") - sys_exit(0) - -# helper to define paths relative to the repo root -def repo_relative(path): - return os.path.abspath(os.path.join(os.path.dirname(__file__), '..', path)) - -# Runs a command in a directory and returns its return code. -# Directory is project root by default, or a relative path from project root -def RunShellCmd(command, start_dir = PROJECT_ROOT): - if start_dir != PROJECT_ROOT: - start_dir = repo_relative(start_dir) - cmd_list = command.split(" ") - subprocess.check_call(cmd_list, cwd=start_dir) - -SUPPORTED_ABIS = [ 'arm64-v8a', 'armeabi-v7a'] -DEFAULT_ABI = SUPPORTED_ABIS[0] -# -# Fetch Android components, build Android VVL -def BuildAndroid(target_abi): - # GitHub actions already comes with NDK pre-installed. We should avoid downloading unless we have to. - # https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md#environment-variables-2 - if "ANDROID_NDK_HOME" not in os.environ: - print('ANDROID_NDK_HOME not defined!') - sys.exit(1) - - os.environ['PATH'] = os.environ.get('ANDROID_NDK_HOME') + os.pathsep + os.environ.get('PATH') - - print("Preparing Android Dependencies\n") - update_sources_cmd = './update_external_sources_android.sh --abi %s --no-build' % target_abi - RunShellCmd(update_sources_cmd, "build-android") - - print("Generating\n") - generate_cmd = './android-generate.sh' - RunShellCmd(generate_cmd, "build-android") - - print("Building Android Layers and Tests\n") - ndk_build_cmd = 'ndk-build APP_ABI=%s -j%s' % (target_abi, os.cpu_count()) - RunShellCmd(ndk_build_cmd, "build-android") - -# -# Module Entrypoint -def main(): - parser = argparse.ArgumentParser() - parser.add_argument( - '-a', '--abi', dest='target_abi', - metavar='ABI', action='store', - choices=SUPPORTED_ABIS, default=DEFAULT_ABI, - help='Build target ABI. Can be one of: {0}'.format( - ', '.join(SUPPORTED_ABIS))) - args = parser.parse_args() - - try: - BuildAndroid(args.target_abi) - - except subprocess.CalledProcessError as proc_error: - print('Command "%s" failed with return code %s' % (' '.join(proc_error.cmd), proc_error.returncode)) - sys.exit(proc_error.returncode) - except Exception as unknown_error: - print('An unkown error occured: %s', unknown_error) - sys.exit(1) - - sys.exit(0) - -if __name__ == '__main__': - main() diff --git a/vkconfig_core/test/CMakeLists.txt b/vkconfig_core/test/CMakeLists.txt index 941e30d333..fbfe028be6 100644 --- a/vkconfig_core/test/CMakeLists.txt +++ b/vkconfig_core/test/CMakeLists.txt @@ -1,4 +1,3 @@ -set(CMAKE_POSITION_INDEPENDENT_CODE ON) set(CMAKE_AUTORCC ON) if (NOT DEFINED CMAKE_INSTALL_BINDIR) diff --git a/vku/CMakeLists.txt b/vku/CMakeLists.txt index cbe34d4da6..5693e6f4dd 100644 --- a/vku/CMakeLists.txt +++ b/vku/CMakeLists.txt @@ -18,8 +18,6 @@ file(GLOB FILES_SOURCE ./*.cpp) file(GLOB FILES_HEADER ./*.h) -set(CMAKE_POSITION_INDEPENDENT_CODE ON) - add_library(vku STATIC ${FILES_SOURCE} ${FILES_HEADER}) target_link_libraries(vku PRIVATE Vulkan::Headers)