diff --git a/changes/sdk/mr.3071.gl.md b/changes/sdk/mr.3071.gl.md new file mode 100644 index 000000000..a10c87ea7 --- /dev/null +++ b/changes/sdk/mr.3071.gl.md @@ -0,0 +1 @@ +Loader: Fix loader build on Universal Windows Platform: build-system-only change. (Included in SDK hotfix 1.0.32.1.) diff --git a/src/loader/CMakeLists.txt b/src/loader/CMakeLists.txt index e8237adb3..89c9f2ca1 100644 --- a/src/loader/CMakeLists.txt +++ b/src/loader/CMakeLists.txt @@ -205,6 +205,13 @@ elseif(WIN32) ) if(MSVC) + if(DYNAMIC_LOADER) + target_sources( + openxr_loader + PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/openxr-loader.def" + ) + endif() + if(DYNAMIC_LOADER AND NOT (CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")) # If building DLLs, force static CRT linkage set_target_properties( @@ -212,10 +219,6 @@ elseif(WIN32) PROPERTIES MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>" ) - target_sources( - openxr_loader - PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/openxr-loader.def" - ) else() # WindowsStore (UWP) apps must be compiled with dynamic CRT linkage (default) # Otherwise for static libs, link the CRT dynamically