From cba7ef4d7d579aadc612c72d3d353f78f7fea4ca Mon Sep 17 00:00:00 2001 From: Rune Berg Date: Wed, 10 Jul 2024 12:35:42 +1200 Subject: [PATCH] Fix android ci build (cmake find_path issue), fix build badges in readme --- CMakeLists.txt | 8 +++++--- README.md | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 097a2e3..00ae2ec 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -192,15 +192,17 @@ target_include_directories(${XRLIB} PUBLIC "${XRLIB_SRC}" ) # For Android, add the native app glue NDK directory if(ANDROID) + message(STATUS "[${XRLIB}] Android NDK path: ${ANDROID_NDK}") + # Add native app glue - find_path(ANDROID_NATIVE_APP_GLUE NAMES android_native_app_glue.h PATHS ${ANDROID_NDK}/sources/android/native_app_glue) + find_path(ANDROID_NATIVE_APP_GLUE NAMES android_native_app_glue.h PATHS "${ANDROID_NDK}/sources/android/native_app_glue" NO_DEFAULT_PATH) if(NOT ANDROID_NATIVE_APP_GLUE) - message(FATAL_ERROR "[${XRLIB}] ERROR: Unable to find native_app_glue in: ${ANDROID_APP_GLUE}") + message(WARNING "[${XRLIB}] WARNING: Unable to find native_app_glue in: **${ANDROID_NDK}/sources/android/native_app_glue** setting manually.") + set(ANDROID_NATIVE_APP_GLUE "${ANDROID_NDK}/sources/android/native_app_glue") endif() target_include_directories(${XRLIB} PUBLIC ${ANDROID_NATIVE_APP_GLUE}) - target_compile_definitions(${XRLIB} PRIVATE XR_USE_PLATFORM_ANDROID=1) endif() message(STATUS "[${XRLIB}] Public include directories defined.") diff --git a/README.md b/README.md index 14e1ba7..93409ae 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # xrlib -[![Desktop builds [ Linux|Windows, Debug|Release, g++|clang++|cl ](https://github.com/1runeberg/xrlib/actions/workflows/desktop_builds.yml/badge.svg)](https://github.com/1runeberg/xrlib/actions/workflows/desktop_builds.yml) [![Android builds [ arm64-v8a, Debug|Release ](https://github.com/1runeberg/xrlib/actions/workflows/android_builds.yml/badge.svg)](https://github.com/1runeberg/xrlib/actions/workflows/android_builds.yml) +[![Desktop builds [ Linux|Windows, Debug|Release, g++|clang++|cl ]](https://github.com/1runeberg/xrlib/actions/workflows/desktop_builds.yml/badge.svg)](https://github.com/1runeberg/xrlib/actions/workflows/desktop_builds.yml)   [![Android builds [ arm64-v8a, Debug|Release ]](https://github.com/1runeberg/xrlib/actions/workflows/android_builds.yml/badge.svg)](https://github.com/1runeberg/xrlib/actions/workflows/android_builds.yml) C++20 OpenXR wrapper library designed to abstract the complexities of the OpenXR API while retaining its flexibility, allowing developers to focus on creating immersive experiences without getting bogged down by low-level details. The library is Vulkan-native and includes an optional PBR renderer, designed from the ground up with mixed reality in mind.