mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-26 17:41:09 +08:00
[openxr-loader] Update, revise (#42464)
This commit is contained in:
parent
55dec59d05
commit
26abb5b33f
@ -1,23 +0,0 @@
|
||||
From d80c7dc3f4810fc49e4444590d39ef71e8a9b01c Mon Sep 17 00:00:00 2001
|
||||
From: Adam Johnson <AdamJohnso@gmail.com>
|
||||
Date: Sat, 19 Feb 2022 19:42:31 -0500
|
||||
Subject: [PATCH] Fix bad import in jinja2
|
||||
|
||||
---
|
||||
external/python/jinja2/utils.py | 6 +++++-
|
||||
1 file changed, 5 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/external/python/jinja2/utils.py b/external/python/jinja2/utils.py
|
||||
index db9c5d06..f198e3ef 100644
|
||||
--- a/external/python/jinja2/utils.py
|
||||
+++ b/external/python/jinja2/utils.py
|
||||
@@ -639,4 +639,8 @@ def __repr__(self):
|
||||
|
||||
|
||||
# Imported here because that's where it was in the past
|
||||
-from markupsafe import Markup, escape, soft_unicode
|
||||
+from markupsafe import Markup, escape
|
||||
+try:
|
||||
+ from markupsafe import soft_unicode
|
||||
+except ImportError:
|
||||
+ from markupsafe import soft_str as soft_unicode
|
@ -7,24 +7,7 @@ index c75b145..386494c 100644
|
||||
|
||||
find_package(Threads REQUIRED)
|
||||
-find_package(JsonCpp)
|
||||
+find_package(jsoncpp CONFIG REQUIRED)
|
||||
+find_package(JSONCPP NAMES jsoncpp REQUIRED)
|
||||
|
||||
### All options defined here
|
||||
option(BUILD_LOADER "Build loader" ON)
|
||||
diff --git a/src/loader/CMakeLists.txt b/src/loader/CMakeLists.txt
|
||||
index 6a88cf4..0821a3d 100644
|
||||
--- a/src/loader/CMakeLists.txt
|
||||
+++ b/src/loader/CMakeLists.txt
|
||||
@@ -68,7 +68,11 @@ add_library(openxr_loader ${LIBRARY_TYPE}
|
||||
${openxr_loader_RESOURCE_FILE}
|
||||
)
|
||||
if(BUILD_WITH_SYSTEM_JSONCPP)
|
||||
- target_link_libraries(openxr_loader PRIVATE JsonCpp::JsonCpp)
|
||||
+ if(BUILD_SHARED_LIBS)
|
||||
+ target_link_libraries(openxr_loader PRIVATE jsoncpp_lib)
|
||||
+ else()
|
||||
+ target_link_libraries(openxr_loader PRIVATE jsoncpp_static)
|
||||
+ endif()
|
||||
else()
|
||||
target_sources(openxr_loader
|
||||
PRIVATE
|
||||
|
14
ports/openxr-loader/msvc-crt.diff
Normal file
14
ports/openxr-loader/msvc-crt.diff
Normal file
@ -0,0 +1,14 @@
|
||||
diff --git a/src/loader/CMakeLists.txt b/src/loader/CMakeLists.txt
|
||||
index 326f74e..3192e69 100644
|
||||
--- a/src/loader/CMakeLists.txt
|
||||
+++ b/src/loader/CMakeLists.txt
|
||||
@@ -212,7 +212,8 @@ elseif(WIN32)
|
||||
)
|
||||
endif()
|
||||
|
||||
- if(DYNAMIC_LOADER AND NOT (CMAKE_SYSTEM_NAME STREQUAL "WindowsStore"))
|
||||
+ if(1) # CRT linkage from vcpkg
|
||||
+ elseif(0)
|
||||
# If building DLLs, force static CRT linkage
|
||||
set_target_properties(
|
||||
openxr_loader
|
@ -1,23 +1,25 @@
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO KhronosGroup/OpenXR-SDK
|
||||
REF "release-${VERSION}"
|
||||
SHA512 6efc7596e707f95366dbcdbac9bd7d0c20735a2175b4edf56a9e8a112cf0ab8b664069fe942313164a37119032ddbf5671bc88ab5f276005dd36e4a4dabba1c7
|
||||
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 04bdb0f16078209b5edd175a3396f70e1ceb8cfa382c65b8fda388e565480e3844daf68e0d987e72ed8c21d3148af0b41a2170911ec1660565887e0e5ae6d2bf
|
||||
SHA512 c2cfab927e6ff8a5a7b90360c99192ae9cd598614965fbd4816361b19c5bf25e5524f0e73ce56774e32903addbce8a8dbcb9520203f845421d33cb33f832977b
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
fix-openxr-sdk-jsoncpp.patch
|
||||
fix-jinja2.patch
|
||||
)
|
||||
|
||||
vcpkg_from_github(
|
||||
@ -30,17 +32,7 @@ vcpkg_from_github(
|
||||
python3_8_compatibility.patch
|
||||
)
|
||||
|
||||
# Weird behavior inside the OpenXR loader. On Windows they force shared libraries to use static crt, and
|
||||
# vice-versa. Might be better in future iterations to patch the CMakeLists.txt for OpenXR
|
||||
if (VCPKG_TARGET_IS_UWP OR VCPKG_TARGET_IS_WINDOWS)
|
||||
if(VCPKG_LIBRARY_LINKAGE STREQUAL static)
|
||||
set(DYNAMIC_LOADER OFF)
|
||||
set(VCPKG_CRT_LINKAGE dynamic)
|
||||
else()
|
||||
set(DYNAMIC_LOADER ON)
|
||||
set(VCPKG_CRT_LINKAGE static)
|
||||
endif()
|
||||
endif()
|
||||
string(COMPARE EQUAL "${VCPKG_LIBRARY_LINKAGE}" "dynamic" DYNAMIC_LOADER)
|
||||
|
||||
vcpkg_find_acquire_program(PYTHON3)
|
||||
|
||||
@ -48,32 +40,32 @@ vcpkg_cmake_configure(
|
||||
SOURCE_PATH "${SOURCE_PATH}"
|
||||
OPTIONS
|
||||
-DBUILD_API_LAYERS=OFF
|
||||
-DBUILD_TESTS=OFF
|
||||
-DBUILD_CONFORMANCE_TESTS=OFF
|
||||
-DBUILD_TESTS=OFF
|
||||
-DCMAKE_INSTALL_INCLUDEDIR=include
|
||||
-DDYNAMIC_LOADER=${DYNAMIC_LOADER}
|
||||
-DPYTHON_EXECUTABLE="${PYTHON3}"
|
||||
-DBUILD_WITH_SYSTEM_JSONCPP=ON
|
||||
"-DPYTHON_EXECUTABLE=${PYTHON3}"
|
||||
)
|
||||
|
||||
vcpkg_cmake_install()
|
||||
vcpkg_fixup_pkgconfig()
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME openxr CONFIG_PATH cmake)
|
||||
else()
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME openxr CONFIG_PATH lib/cmake/openxr)
|
||||
endif()
|
||||
|
||||
# Generate the OpenXR C++ bindings
|
||||
set(ENV{OPENXR_REPO} "${SDK_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 "${SDK_SOURCE_PATH}/specification/registry/xr.xml" -o "${CURRENT_PACKAGES_DIR}/include/openxr"
|
||||
WORKING_DIRECTORY "${HPP_SOURCE_PATH}"
|
||||
LOGNAME "openxr-hpp"
|
||||
)
|
||||
|
||||
if(VCPKG_TARGET_IS_WINDOWS)
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME OpenXR CONFIG_PATH cmake)
|
||||
else()
|
||||
vcpkg_cmake_config_fixup(PACKAGE_NAME OpenXR CONFIG_PATH lib/cmake/openxr)
|
||||
endif()
|
||||
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
||||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
||||
|
||||
vcpkg_fixup_pkgconfig()
|
||||
vcpkg_copy_pdbs()
|
||||
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
|
||||
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
|
||||
|
@ -1,12 +1,20 @@
|
||||
{
|
||||
"name": "openxr-loader",
|
||||
"version": "1.0.31",
|
||||
"version": "1.0.34",
|
||||
"description": "A royalty-free, open standard that provides high-performance access to Augmented Reality (AR) and Virtual Reality (VR)—collectively known as XR—platforms and devices",
|
||||
"homepage": "https://github.com/KhronosGroup/OpenXR-SDK",
|
||||
"license": "Apache-2.0",
|
||||
"supports": "!uwp & !osx",
|
||||
"dependencies": [
|
||||
{
|
||||
"name": "egl",
|
||||
"platform": "android"
|
||||
},
|
||||
"jsoncpp",
|
||||
{
|
||||
"name": "opengl",
|
||||
"platform": "!android & !ios & !osx & !(arm & windows) & !uwp"
|
||||
},
|
||||
{
|
||||
"name": "vcpkg-cmake",
|
||||
"host": true
|
||||
@ -19,6 +27,7 @@
|
||||
"features": {
|
||||
"vulkan": {
|
||||
"description": "Vulkan functionality for OpenXR",
|
||||
"supports": "!(arm & windows) & !uwp",
|
||||
"dependencies": [
|
||||
"vulkan"
|
||||
]
|
||||
|
@ -6789,7 +6789,7 @@
|
||||
"port-version": 0
|
||||
},
|
||||
"openxr-loader": {
|
||||
"baseline": "1.0.31",
|
||||
"baseline": "1.0.34",
|
||||
"port-version": 0
|
||||
},
|
||||
"optimus-cpp": {
|
||||
|
@ -1,5 +1,10 @@
|
||||
{
|
||||
"versions": [
|
||||
{
|
||||
"git-tree": "7ac79e9eb86bad29f5fc6d3f6f25389df13e5b9f",
|
||||
"version": "1.0.34",
|
||||
"port-version": 0
|
||||
},
|
||||
{
|
||||
"git-tree": "a8275bf000597b3d7cd12109347f21552bcd39cc",
|
||||
"version": "1.0.31",
|
||||
|
Loading…
x
Reference in New Issue
Block a user