From 449ccf07e05fdcd8f837ffaddb8768510e8500f7 Mon Sep 17 00:00:00 2001 From: Ray Molenkamp Date: Mon, 22 Feb 2021 11:08:52 -0700 Subject: [PATCH] CMake/Windows: Update for new XR_OPENXR version This updates platform/platform_win32.cmake to support both the old and new library names for OpenXR. The new version links against one additional system library and the debug library filename changed ever so slightly. This is a temporary workaround and can be removed once the new lib versions have landed. --- build_files/cmake/platform/platform_win32.cmake | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/build_files/cmake/platform/platform_win32.cmake b/build_files/cmake/platform/platform_win32.cmake index b303358d0b8..e739e8ee5a2 100644 --- a/build_files/cmake/platform/platform_win32.cmake +++ b/build_files/cmake/platform/platform_win32.cmake @@ -119,6 +119,7 @@ string(APPEND CMAKE_MODULE_LINKER_FLAGS " /SAFESEH:NO /ignore:4099") list(APPEND PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 Comctl32 version advapi32 shfolder shell32 ole32 oleaut32 uuid psapi Dbghelp Shlwapi + pathcch ) if(WITH_INPUT_IME) @@ -791,7 +792,14 @@ if(WITH_XR_OPENXR) set(XR_OPENXR_SDK ${LIBDIR}/xr_openxr_sdk) set(XR_OPENXR_SDK_LIBPATH ${LIBDIR}/xr_openxr_sdk/lib) set(XR_OPENXR_SDK_INCLUDE_DIR ${XR_OPENXR_SDK}/include) - set(XR_OPENXR_SDK_LIBRARIES optimized ${XR_OPENXR_SDK_LIBPATH}/openxr_loader.lib debug ${XR_OPENXR_SDK_LIBPATH}/openxr_loader_d.lib) + # This is the old name of this library, it is checked to + # support the transition between the old and new lib versions + # this can be removed after the next lib update. + if(EXISTS ${XR_OPENXR_SDK_LIBPATH}/openxr_loader_d.lib) + set(XR_OPENXR_SDK_LIBRARIES optimized ${XR_OPENXR_SDK_LIBPATH}/openxr_loader.lib debug ${XR_OPENXR_SDK_LIBPATH}/openxr_loader_d.lib) + else() + set(XR_OPENXR_SDK_LIBRARIES optimized ${XR_OPENXR_SDK_LIBPATH}/openxr_loader.lib debug ${XR_OPENXR_SDK_LIBPATH}/openxr_loaderd.lib) + endif() else() message(WARNING "OpenXR-SDK was not found, disabling WITH_XR_OPENXR") set(WITH_XR_OPENXR OFF)