Skip to content

feat(windows): cross-build the x64 program on a Mac or Linux - #3

Merged
oenderg merged 2 commits into
mainfrom
feat/windows-x64-cross
Nov 15, 2026
Merged

oenderg merged 2 commits into
mainfrom
feat/windows-x64-cross

Conversation

@oenderg

@oenderg oenderg commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

What

Cross-builds the x86-64 Windows program on a Mac or Linux, with no Windows and no MSYS2:

TL_WIN_TOOLCHAIN=<toolchain folder> runtime/win/build-x64-cross.sh game-portable   # or: game

The release workflow keeps building and shipping the MSYS2 build. This adds a second way to make the same program, and a CI check that it keeps working.

How it works

  • runtime/win/x64/cross/setup-sysroot.sh unpacks the MSYS2 CLANG64 packages pinned in msys2-sysroot.txt (the same versions as msys2-clang64.txt, each with its SHA-256) into a folder: LLVM 23's headers, CMake package and import library for Windows, and the DLLs the program ships with.
  • build-scarletnx.sh cross-builds ScarletNX's recompiler library (same pinned commit, same patch) with llvm-mingw, using ScarletNX's own Windows cross-build support and the sysroot's LLVM CMake package.
  • build-x64.sh takes the tools from llvm-mingw when X64_CROSS_SYSROOT is set. The program's own C++ (the dark mode shim) links libc++ and libunwind statically, so it imports only libLLVM-23.dll and libwinpthread-1.dll besides Windows' own DLLs, and the process has one libc++ DLL.
  • collect-dlls.sh now fails when a program imports a lib*.dll it cannot find. The first cross-built link imported libunwind.dll, which the script skipped without a word.
  • runtime/win/build-x64-cross.sh runs the steps and leaves the program and its DLLs where package-zip.sh and build-installer.sh already look.
  • CI: windows-x64-cross builds it on a macOS runner, and smoke-x64-cross starts it twice in the MSYS2 zip's place, like the existing smoke test. Neither is a dependency of publish, so a failure shows in the run without holding a release back.

Tested

  • Mac: portable and installed (WinSparkle) builds, 8 DLLs collected, the same set the MSYS2 build ships.
  • CrossOver on the Mac: the cross-built program translates the whole game from scratch (89,699 functions) and then plays at 60 fps with no faults. An earlier build from the same scripts did the same.
  • CI on this branch (run 43413783584): the MSYS2 and ARM64 routes are unchanged and pass, the cross-build job passes on a macOS runner, and the cross-built program starts twice on a Windows Server runner (smoke-x64-cross): the first start translates and draws the Welcome screen, the second finds the translation and draws it again, both matching the baseline.

Not covered

  • No physical Windows PC or VM with a GPU has run a cross-built program: the smoke runners draw with Windows' software renderer, so frames count and the frame rate does not.
  • Reflourished does not have these files yet.

@oenderg
oenderg merged commit d41ce94 into main Nov 15, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant