KhronosGroup / OpenXR-Tutorials

OpenXR Tutorials
https://www.openxr-tutorial.com/
Apache License 2.0
86 stars 15 forks source link

Fix build failed due to missing AndroidNdkModules #114

Closed jypeitao closed 9 months ago

jypeitao commented 9 months ago

AndroidNdkModules.cmake has been deleted by NDK

CLAassistant commented 9 months ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


tao.pei seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

rbessems commented 9 months ago

@jypeitao which version of NDK had this file removed?

jypeitao commented 9 months ago

Change user and further confirm the problem.

jypeitao commented 9 months ago

C++ build system [configure] failed while executing: /usr/bin/cmake \ -H/home/peter/wk2/os/OpenXR-Tutorials/Chapter5 \ -DCMAKE_SYSTEM_NAME=Android \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCMAKE_SYSTEM_VERSION=27 \ -DANDROID_PLATFORM=android-27 \ -DANDROID_ABI=x86 \ -DCMAKE_ANDROID_ARCH_ABI=x86 \ -DANDROID_NDK=/home/peter/Android/Sdk/ndk/23.1.7779620 \ -DCMAKE_ANDROID_NDK=/home/peter/Android/Sdk/ndk/23.1.7779620 \ -DCMAKE_TOOLCHAIN_FILE=/home/peter/Android/Sdk/ndk/23.1.7779620/build/cmake/android.toolchain.cmake \ -DCMAKE_MAKE_PROGRAM=/usr/bin/ninja \ -DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/home/peter/wk2/os/OpenXR-Tutorials/Chapter5/app/build/intermediates/cxx/Debug/3v245142/obj/x86 \ -DCMAKE_RUNTIME_OUTPUT_DIRECTORY=/home/peter/wk2/os/OpenXR-Tutorials/Chapter5/app/build/intermediates/cxx/Debug/3v245142/obj/x86 \ -DCMAKE_BUILD_TYPE=Debug \ -DCMAKE_FIND_ROOT_PATH=/home/peter/wk2/os/OpenXR-Tutorials/Chapter5/app/.cxx/Debug/3v245142/prefab/x86/prefab \ -B/home/peter/wk2/os/OpenXR-Tutorials/Chapter5/app/.cxx/Debug/3v245142/x86 \ -GNinja from /home/peter/wk2/os/OpenXR-Tutorials/Chapter5/app CMake Error at CMakeLists.txt:97 (include): include could not find requested file:

AndroidNdkModules

Found cmake in another path instead of Android sdk. Add cmake.dir=/home/peter/Android/Sdk/cmake/3.22.1 will be OK. But it needs to be added manually. I think even if it is cmake under another path, gradle can also add the cmake Modules path under android sdk.

Anyway, close this pr first.

rickyjames35 commented 3 weeks ago

I'm running into this issue as well. I'm not very familiar with gradle. My fix was to make CMake aware of it in the CMakeLists.txt:

    # native_app_glue
    list(APPEND CMAKE_MODULE_PATH "$ENV{HOME}/Android/Sdk/cmake/3.22.1/share/cmake-3.22/Modules")
    include(AndroidNdkModules)
    android_ndk_import_module_native_app_glue()