Repository navigation
Build the Windows runtime on Linux with clang-cl and xwin - #888
Merged
ItsNotRexed merged 1 commit intoNov 22, 2026
Merged
Conversation
runtime/cmake/clang-cl-xwin.cmake cross-compiles gta6rt, its shims and tests with clang-cl and lld-link (LLVM 19+) against an MSVC CRT and Windows SDK laid out by xwin, and makes ctest run them through Wine (or Proton's wine). llvm-ml64 stands in for ml64, so the register- preservation check in unimplemented_policy_test runs too. Changes that let a cross build work without a Developer Prompt: - gen_d3d12_stubs.py gets the d3d12.h CMake finds (--header) instead of relying on INCLUDE; without one the COM targets are skipped. - d3d12_trace names the interpreter by path, so ctest doesn't prepend the emulator to Python, and check_d3d12_trace.py starts the fixture through the emulator (--runner). docs/testing.md describes the build and the Wine and Proton runs.
quackottu
reviewed
Nov 22, 2026
quackottu
left a comment
Contributor
There was a problem hiding this comment.
Tested 943e5f8 on NVIDIA GeForce RTX 5070, driver 621.24, Windows 11 Pro (26300), VS 2022 Build Tools, Vulkan SDK 1.4.363.0, with LEONIDA_VK_VALIDATION=1 and LEONIDA_D3D12=vulkan: pass
ctest -C RelWithDebInfo: 100% tests passed, 0 tests failed out of 32- 32 test programs in the build pass with 0 validation errors
d3d12_clear_testfails (R8G8B8A8_UNORM/SNORM 0.5 ties and a D16 clear byte differ from WARP) exactly as onmain4a36bb1 here, so not from this PR; #521 addresses it
Implicit Vulkan layers (overlays) were off through an empty VK_IMPLICIT_LAYER_PATH.
This was referenced Nov 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
New BUILD item (claim): build the Windows runtime on Linux and run its tests under Wine or Proton.
What and why
Today
gta6rt, its shims and their tests only build on Windows with Visual Studio. The Wine CI job (#747) andmake_game.py --runtime-build(#768) both take a build made on a Windows machine. This lets a Linux contributor build and test the runtime locally:runtime/cmake/clang-cl-xwin.cmake: a toolchain file for clang-cl + lld-link (LLVM 19+) against an MSVC CRT and Windows SDK laid out by xwin.ctestruns the tests through Wine, or Proton'swine, viaCMAKE_CROSSCOMPILING_EMULATOR.llvm-ml64stands in forml64, sounimplemented_policy_testkeeps its register-preservation check.runtime/CMakeLists.txt: in a cross build,gen_d3d12_stubs.pygets thed3d12.hCMake finds (--header) instead of relying onINCLUDE.d3d12_tracenames the interpreter by path, so ctest doesn't put the emulator in front of Python.runtime/test/check_d3d12_trace.py:--runnerstarts the fixture through the emulator.docs/testing.md: the build and the Wine and Proton runs.The native Windows build is unchanged: the new branches only apply when
CMAKE_CROSSCOMPILINGis set, and"${Python3_EXECUTABLE}"is the same path asPython3::Interpreter. The plain Linux build (Vulkan tools only) is unchanged.Tested
On
mainat 4a36bb1, CachyOS (Linux 7.3.5), AMD Ryzen 7 7700X iGPU (RDNA2, RADV, Mesa 26.3.1), clang-cl/LLD 23.1.5, CMake 4.5.1, xwin 0.10.0 (SDK 10.0.26100, CRT 14.44):runtime/build/linux)The failures are the tests that compare with the host D3D12 runtime:
root_sig_test,root_sig,d3d12_vulkan_device, plusdevice_proxyunder Wine (it passes on vkd3d-proton). Those are TEST-105 (#869). Under Proton,pe_loader_boundsalso fails until #846 lands; its fix was in this branch too and was dropped because #846 had it first.Not tested here: the native Windows MSVC build (no Windows machine); the CI on this PR covers it.
Related
gen_d3d12_stubs.pycommand block, so whichever lands second gets a small rebase conflict.AI-assisted (Claude-Opus).