diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7b1c4795e5..fc214ed363 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -86,3 +86,27 @@ jobs: - 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: + - uses: actions/checkout@v3 + - uses: actions/setup-python@v4 + with: + python-version: '3.8' + - uses: lukka/get-cmake@latest + - name: Configure + run: | + cmake -S . -B build/ --toolchain $ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake \ + -D ANDROID_PLATFORM=26 \ + -D CMAKE_ANDROID_ARCH_ABI=arm64-v8a \ + -D CMAKE_ANDROID_STL_TYPE=c++_static \ + -D ANDROID_USE_LEGACY_TOOLCHAIN_FILE=NO \ + -D CMAKE_BUILD_TYPE=Release \ + -D UPDATE_DEPS=ON \ + -G "Ninja" + - name: Build + run: cmake --build build + - name: Install + run: cmake --install build --prefix build/install + \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a6457bf33..134423238e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,9 +72,21 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Windows" OR option(BUILD_LAYERMGR "Build Vulkan Configurator" ON) +elseif(ANDROID) + + # Currently the Android build only build the API dump and screen shot layer. + # - libVkLayer_api_dump.so + # - libVkLayer_screenshot.so + option(BUILD_APIDUMP "Build api_dump layer" ON) + set(BUILD_MONITOR OFF) + option(BUILD_SCREENSHOT "Build screenshot layer" ON) + set(BUILD_DEMOS OFF) + set(BUILD_VKJSON OFF) + set(BUILD_VIA OFF) + set(BUILD_LAYERMGR OFF) + elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin") - option(BUILD_LOADER OFF) option(BUILD_APIDUMP "Build api_dump layer" ON) option(BUILD_MONITOR "Build monitor layer" ON) option(BUILD_SCREENSHOT "Build screenshot layer" ON) diff --git a/layersvt/CMakeLists.txt b/layersvt/CMakeLists.txt index 03a9f839c2..b5edfe7da8 100644 --- a/layersvt/CMakeLists.txt +++ b/layersvt/CMakeLists.txt @@ -96,6 +96,9 @@ else() if (NOT APPLE) set_target_properties(VkLayer_${target} PROPERTIES LINK_FLAGS "-Wl,-Bsymbolic") endif () + if (ANDROID) + target_link_Libraries(VkLayer_${target} log) + endif() install(TARGETS VkLayer_${target} DESTINATION ${CMAKE_INSTALL_LIBDIR}) endmacro() endif() @@ -170,7 +173,10 @@ if (NOT APPLE) endif () endif () -# json file creation +if (ANDROID) + message(DEBUG "Android doesn't use json manifests.") + return() +endif() # The output file needs Unix "/" separators or Windows "\" separators # Windows paths need to start with ".\", Unix paths do not. diff --git a/scripts/known_good.json b/scripts/known_good.json index 572adf2ea9..c346fde803 100644 --- a/scripts/known_good.json +++ b/scripts/known_good.json @@ -34,6 +34,11 @@ "var_name": "VULKAN_HEADERS_INSTALL_DIR", "repo_name": "Vulkan-Headers" } + ], + "build_platforms": [ + "windows", + "linux", + "darwin" ] }, { diff --git a/vku/CMakeLists.txt b/vku/CMakeLists.txt index 1c2f10a058..cbe34d4da6 100644 --- a/vku/CMakeLists.txt +++ b/vku/CMakeLists.txt @@ -29,8 +29,7 @@ if(WIN32) else() set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") endif() -install(TARGETS vku DESTINATION ${CMAKE_INSTALL_LIBDIR}) + set_target_properties(vku PROPERTIES LINKER_LANGUAGE CXX) include_directories(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/generated) -