The open source OpenXR runtime

build: Fix compilation with Clang64 on MSYS2 Avoid using pthread_windows, WIL and D3D libraries when compiling on this environment.

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2415>

authored by

Elise Doucet and committed by
Marge Bot
907fd6d3 3009f375

+9 -2
+4 -2
CMakeLists.txt
··· 126 126 find_library(ANDROID_LIBRARY android) 127 127 find_library(ANDROID_LOG_LIBRARY log) 128 128 endif() 129 - if(WIN32) 129 + # D3D is disabled on MINGW as WIL is lacking official support. 130 + # If necessary, please refer to https://github.com/microsoft/wil/pull/467 131 + if(WIN32 AND NOT MINGW) 130 132 find_package(wil CONFIG) 131 133 set(D3D11_LIBRARY d3d11) 132 134 set(D3D12_LIBRARY d3d12) ··· 138 140 find_package(Sanitizers MODULE) 139 141 140 142 add_library(xrt-pthreads INTERFACE) 141 - if(WIN32) 143 + if(WIN32 AND NOT MINGW) 142 144 find_package(pthreads_windows REQUIRED) 143 145 target_link_libraries(xrt-pthreads INTERFACE PThreads4W::PThreads4W_CXXEXC) 144 146 else()
+5
src/xrt/auxiliary/util/CMakeLists.txt
··· 126 126 # Only uses normal Windows libraries, doesn't add anything extra. 127 127 if(WIN32) 128 128 target_sources(aux_util PRIVATE u_windows.c u_windows.h) 129 + endif() 130 + 131 + # WIL is lacking official support on MINGW. 132 + # If necessary, please refer to https://github.com/microsoft/wil/pull/467 133 + if(WIN32 AND NOT MINGW) 129 134 target_link_libraries(aux_util PRIVATE WIL::WIL) 130 135 endif() 131 136