Skip to content

Commit

Permalink
[openxr-loader] Build from SDK source repo
Browse files Browse the repository at this point in the history
  • Loading branch information
dg0yt committed Dec 7, 2024
1 parent 1a7ddd8 commit b26520e
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 34 deletions.
12 changes: 0 additions & 12 deletions ports/openxr-loader/fix-config-error.patch

This file was deleted.

16 changes: 14 additions & 2 deletions ports/openxr-loader/fix-openxr-sdk-jsoncpp.patch
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c75b145..386494c 100644
index e618325..21d977f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -89,7 +89,7 @@ if(NOT VULKAN_INCOMPATIBLE)
@@ -107,7 +107,7 @@ if(NOT VULKAN_INCOMPATIBLE)
endif()

find_package(Threads REQUIRED)
Expand All @@ -11,3 +11,15 @@ index c75b145..386494c 100644

### All options defined here
option(BUILD_LOADER "Build loader" ON)
diff --git a/src/loader/OpenXRConfig.cmake.in b/src/loader/OpenXRConfig.cmake.in
index 81b12e7..4c24771 100644
--- a/src/loader/OpenXRConfig.cmake.in
+++ b/src/loader/OpenXRConfig.cmake.in
@@ -6,6 +6,7 @@

include(CMakeFindDependencyMacro)
find_dependency(Threads)
+find_dependency(jsoncpp CONFIG)

include("${CMAKE_CURRENT_LIST_DIR}/OpenXRTargets.cmake")

27 changes: 8 additions & 19 deletions ports/openxr-loader/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,26 +1,12 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO KhronosGroup/OpenXR-SDK
REF "release-${VERSION}"
SHA512 cfcabbd130f89d1d46899f3a9a34e9b5d9b21903b6d0fc48c62e233401cf200107a9fa8da926fc0036937a9ed647a2376bee58db925654c41acc7580f8f3a053
HEAD_REF master
PATCHES
fix-openxr-sdk-jsoncpp.patch
msvc-crt.diff
)
file(GLOB gl_headers "${SOURCE_PATH}/external/include/GL/*")
list(REMOVE_ITEM gl_headers "${SOURCE_PATH}/external/include/gl_format.h")
file(REMOVE ${gl_headers})

vcpkg_from_github(
OUT_SOURCE_PATH SDK_SOURCE_PATH
REPO KhronosGroup/OpenXR-SDK-Source
REF "release-${VERSION}"
SHA512 c2cfab927e6ff8a5a7b90360c99192ae9cd598614965fbd4816361b19c5bf25e5524f0e73ce56774e32903addbce8a8dbcb9520203f845421d33cb33f832977b
HEAD_REF master
PATCHES
fix-openxr-sdk-jsoncpp.patch
fix-config-error.patch
msvc-crt.diff
)

vcpkg_from_github(
Expand Down Expand Up @@ -59,14 +45,17 @@ else()
endif()

# Generate the OpenXR C++ bindings
set(ENV{OPENXR_REPO} "${SDK_SOURCE_PATH}")
set(ENV{OPENXR_REPO} "${SOURCE_PATH}")
vcpkg_execute_required_process(
COMMAND "${PYTHON3}" "${HPP_SOURCE_PATH}/scripts/hpp_genxr.py" -quiet -registry "${SDK_SOURCE_PATH}/specification/registry/xr.xml" -o "${CURRENT_PACKAGES_DIR}/include/openxr"
COMMAND "${PYTHON3}" "${HPP_SOURCE_PATH}/scripts/hpp_genxr.py" -quiet -registry "${SOURCE_PATH}/specification/registry/xr.xml" -o "${CURRENT_PACKAGES_DIR}/include/openxr"
WORKING_DIRECTORY "${HPP_SOURCE_PATH}"
LOGNAME "openxr-hpp"
)

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/share/doc"
)

vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
2 changes: 1 addition & 1 deletion versions/o-/openxr-loader.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"versions": [
{
"git-tree": "444fda775f58854569eaffa1a4d336c44f94243c",
"git-tree": "f2e5042ea0bf35cabb2dfe5a7428b5e226e93a47",
"version": "1.0.34",
"port-version": 1
},
Expand Down

0 comments on commit b26520e

Please sign in to comment.