From efe544dac0133e0aeab72fc038f983bd9b33995d Mon Sep 17 00:00:00 2001 From: UwUCammie Date: Tue, 24 Nov 2026 14:53:36 +0000 Subject: [PATCH] build: link synchronization for the Rust XMA2 decoder (BUILD-XMA2-SYNCH-LIB) Rust's std imports WaitOnAddress, WakeByAddressSingle and WakeByAddressAll from synchronization.lib. A clang-cl build against an xwin SDK does not pull that library in on its own, so gta6rt and acphal_test failed to link with lld-link: undefined symbol __declspec(dllimport) WaitOnAddress once cargo built runtime/xma_decoder. Name it next to the decoder's other link dependencies. --- runtime/CMakeLists.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runtime/CMakeLists.txt b/runtime/CMakeLists.txt index a23b79290f..866849d051 100644 --- a/runtime/CMakeLists.txt +++ b/runtime/CMakeLists.txt @@ -129,11 +129,13 @@ if(WIN32 AND LEONIDA_BUILD_WINDOWS_RUNTIME) add_library(leonida_xma2_decoder STATIC IMPORTED) # Link Rust's Windows SDK dependencies. CMake's C++ target selects its own CRT # (/MD or /MDd); the C ABI keeps allocation and deallocation on the same side. + # synchronization: Rust's std imports WaitOnAddress and WakeByAddress*, which MSVC's + # default libraries cover but clang-cl with an xwin SDK does not (lld-link: undefined symbol). set_target_properties(leonida_xma2_decoder PROPERTIES IMPORTED_LOCATION ${_xma_lib} INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/xma_decoder INTERFACE_COMPILE_DEFINITIONS LEONIDA_HAVE_XMA2_DECODER=1 - INTERFACE_LINK_LIBRARIES "kernel32;ntdll;userenv;ws2_32;dbghelp") + INTERFACE_LINK_LIBRARIES "kernel32;ntdll;userenv;ws2_32;dbghelp;synchronization") else() message(WARNING "cargo build of runtime/xma_decoder failed: XMA voices will be silent") endif()