Skip to content

Commit

Permalink
update openvr.cmake
Browse files Browse the repository at this point in the history
  • Loading branch information
comoco-xiao authored and fbxiang committed Feb 20, 2025
1 parent 62e2511 commit 8a27c1a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 67 deletions.
32 changes: 2 additions & 30 deletions cmake/openvr.cmake
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include(FetchContent)
FetchContent_Declare(
openvr
GIT_REPOSITORY https://github.com/ValveSoftware/openvr.git
GIT_TAG v2.2.3
GIT_REPOSITORY https://github.com/comoco-xiao/openvr.git
GIT_TAG v0.0.1
GIT_SHALLOW TRUE
GIT_PROGRESS TRUE
)
Expand All @@ -20,32 +20,4 @@ endif()
# HACK: disable openvr log
if (NOT MSVC)
target_compile_options(openvr_api PRIVATE -include ${CMAKE_CURRENT_SOURCE_DIR}/cmake/openvr_definitions.h)
endif()

# apply patch
if(APPLE)
set(PATCH_FILE "${CMAKE_CURRENT_SOURCE_DIR}/patches/openvr-v2.2.3-for-apple.patch")
execute_process(
COMMAND git apply --check ${PATCH_FILE}
WORKING_DIRECTORY ${openvr_SOURCE_DIR}
RESULT_VARIABLE PATCH_RESULT
OUTPUT_QUIET
ERROR_QUIET
)
if(PATCH_RESULT EQUAL 0)
execute_process(
COMMAND git apply ${PATCH_FILE}
WORKING_DIRECTORY ${openvr_SOURCE_DIR}
RESULT_VARIABLE APPLY_RESULT
OUTPUT_VARIABLE APPLY_OUTPUT
ERROR_VARIABLE APPLY_ERROR
)
if(NOT APPLY_RESULT EQUAL 0)
message(FATAL_ERROR "Failed to apply openvr patch:\n${APPLY_OUTPUT}\n${APPLY_ERROR}")
else()
message(STATUS "Openvr patch applied successfully.")
endif()
else()
message(STATUS "Openvr patch already applied.")
endif()
endif()
37 changes: 0 additions & 37 deletions patches/openvr-v2.2.3-for-apple.patch

This file was deleted.

0 comments on commit 8a27c1a

Please sign in to comment.