Link openxr_loader into ppsspp_jni for the Android VR build

The Android VR build (ANDROID=true, OPENXR=TRUE) was failing to link
ppsspp_jni with undefined references to xrGetInstanceProcAddr,
xrCreateReferenceSpace, xrEnumerateViewConfigurations, etc. - all called
from Common/VR/*.cpp, which is unconditionally part of Common and always
linked into ppsspp_jni via core.

openxr_loader (built via ext/OpenXR-SDK whenever OPENXR AND NOT
ARMV7_DEVICE) was only ever being added to targetExtraLibs, which just
${TargetBin} - the desktop-style executable - consumes. ppsspp_jni,
the actual Android JNI target Gradle's CMake external native build
uses, never got it. Link it in directly, gated the same way OpenXR is
gated everywhere else in the file.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
Henrik RydgårdandClaude Sonnet 5 committed 2026-07-24 19:57:57 +02:00
1 parent 93bfd41e78
commit 4f3336016f
1 file changed
+6 -4
+6 -4
View File
@@ -1341,10 +1341,6 @@ set(targetExtra)
set(targetExtraLibs)
set(UISource)
if(OPENXR AND NOT ARMV7_DEVICE)
list(APPEND targetExtraLibs openxr_loader)
endif()
if(IOS OR MACOSX)
list(APPEND targetExtra
Common/Render/Text/draw_text_cocoa.mm
@@ -2761,6 +2757,12 @@ if(ANDROID AND NOT LIBRETRO)
if(TARGET ppsspp_ui)
target_link_libraries(ppsspp_jni ppsspp_ui)
endif()
if(OPENXR AND NOT ARMV7_DEVICE)
# Common/VR/*.cpp (part of Common, always linked in via core) calls directly into
# the OpenXR loader, so ppsspp_jni needs this too - not just ${TargetBin}, which is
# what openxr_loader was previously only being linked into.
target_link_libraries(ppsspp_jni openxr_loader)
endif()
if(ARM64)
# Support 16kb page size on Android
target_link_options(ppsspp_jni PRIVATE "-Wl,-z,max-page-size=16384")