Add Oculus OpenXR loader submodule;

This commit is contained in:
bjorn 2022-03-21 03:10:13 -07:00
parent 0b2c2525ba
commit c097a266b4
4 changed files with 6 additions and 7 deletions

3
.gitmodules vendored
View File

@ -28,3 +28,6 @@
[submodule "deps/oculus-pc"]
path = deps/oculus-pc
url = https://github.com/lovr-org/ovr_sdk_pc
[submodule "deps/oculus-openxr"]
path = deps/oculus-openxr
url = https://github.com/lovr-org/ovr_openxr_mobile_sdk

View File

@ -196,15 +196,11 @@ if(LOVR_ENABLE_HEADSET AND LOVR_USE_OPENVR)
endif()
# OpenXR
# Currently, to use OpenXR, add the OpenXR SDK to the deps folder:
# git submodule add https://github.com/khronosgroup/openxr-sdk deps/openxr
# On Android, download the Oculus OpenXR loader and place the "OpenXR" folder at "deps/OpenXR-Oculus"
if(LOVR_ENABLE_HEADSET AND LOVR_USE_OPENXR)
include_directories(deps/openxr/include)
if(ANDROID)
set(LOVR_OPENXR_OCULUS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/deps/OpenXR-Oculus" CACHE STRING "The path to the Oculus OpenXR loader")
set(LOVR_OPENXR_OCULUS_PATH "${CMAKE_CURRENT_SOURCE_DIR}/deps/oculus-openxr" CACHE STRING "The path to the Oculus OpenXR loader")
add_library(openxr_loader SHARED IMPORTED)
include_directories("${LOVR_OPENXR_OCULUS_PATH}/Include")
set_target_properties(openxr_loader PROPERTIES IMPORTED_LOCATION "${LOVR_OPENXR_OCULUS_PATH}/Libs/Android/${ANDROID_ABI}/Release/libopenxr_loader.so")
set(LOVR_OPENXR openxr_loader)
else()

View File

@ -325,9 +325,8 @@ end
if config.headsets.openxr then
if target == 'android' then
cflags_headset_openxr += '-Ideps/openxr/include'
cflags_headset_openxr += '-Ideps/OpenXR-Oculus/Include'
lflags += '-lopenxr_loader'
copy('deps/OpenXR-Oculus/Libs/Android/arm64-v8a/Release/libopenxr_loader.so', '$(bin)/%b')
copy('deps/oculus-openxr/Libs/Android/arm64-v8a/Release/libopenxr_loader.so', '$(bin)/%b')
else
if type(config.headsets.openxr) ~= 'string' then
error('Sorry, building OpenXR is not supported yet. However, you can set config.headsets.openxr to a path to a folder containing the OpenXR library.')

1
deps/oculus-openxr vendored Submodule

@ -0,0 +1 @@
Subproject commit ad4021367f0d8b5cd8efafae5cbc3d783eeb22a7