--- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -64,6 +64,19 @@ endif(WIN32) endif(ENABLE_OPENGL) +# OpenXR loader (Android only for now - see android/app/src/main/cpp/ +# xr_session.c, which submits the game's existing render as a composition +# layer instead of presenting to a normal window/surface). EGL is linked +# explicitly too - xr_session.c calls eglGetCurrentDisplay/Context/ +# QueryContext/ChooseConfig directly (to share the GL context gl4es/SDL +# already made), and unlike GL itself (where gl4es's own libGL.so already +# provides every symbol the engine or xr_session.c call), there's no other +# EGL provider in this link. +if(ANDROID) + set(OPENXR_INCLUDE_DIRS ${ANDROID_PREBUILT_DIR}/openxr/include) + set(OPENXR_LIBRARIES ${ANDROID_PREBUILT_DIR}/openxr/lib/libopenxr_loader.so EGL) +endif(ANDROID) + if(ENABLE_SDL2 MATCHES "ON") find_package(SDL2 REQUIRED) if(SDL2_FOUND) @@ -109,6 +122,8 @@ ${SDL2_MIXER_INCLUDE_DIRS} ${FLUIDSYNTH_INCLUDE_DIRS} ${OPENGL_INCLUDE_DIRS} + ${OPENXR_INCLUDE_DIRS} + ${ANDROID_EXTRA_INCLUDE_DIRS} ) if(NOT WIN32) @@ -439,6 +454,7 @@ ${SDL2_MIXER_LIBRARIES} ${FLUIDSYNTH_LIBRARIES} ${OPENGL_LIBRARIES} + ${OPENXR_LIBRARIES} ${ALSA_LIBRARIES} $<$:log> )