fix windows build

This commit is contained in:
RandomityGuy 2026-06-16 01:07:00 +01:00
parent c4e4a36c6d
commit 00e95673b0

View file

@ -440,18 +440,23 @@ jobs:
haxe compile-c.hxml
- run:
name: Compile MBHaxe (single translation unit)
shell: cmd.exe
# Build the self-contained marblegame.c in one cl invocation (like compile.bat /
# the macOS & Linux jobs) instead of MSBuild compiling ~900 split files serially
# with whole-program optimization. HL_MAKE must NOT be defined so marblegame.c
# #includes all the generated .c files into a single translation unit.
# The batch commands are written to a real .bat file so `%%i`/`for` work; running
# them via `shell: cmd.exe` directly does not (cmd treats it as inline, not a script).
command: |
cd %USERPROFILE%\project\native
cd ~/project/native
cat > build.bat <<'EOF'
cd /d %USERPROFILE%\project\native
if not exist x64\Release mkdir x64\Release
for /f "usebackq delims=" %%i in (`"C:\Program Files (x86)\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products * -find VC\Auxiliary\Build\vcvars64.bat`) do call "%%i"
set HL=%USERPROFILE%\deps\hashlink
cl /nologo marblegame.c /Fe:x64\Release\marblegame.exe /O2 /MD /DNDEBUG -I . -I "%HL%\src" -I "%HL%\include" "%HL%\x64\Release\libhl.lib" "%HL%\x64\Release\ssl.lib" "%HL%\x64\Release\ui.lib" "%HL%\x64\Release\datachannel.lib" "%HL%\x64\Release\openal.lib" "%HL%\x64\Release\uv.lib" "%HL%\x64\Release\fmt.lib" "%HL%\x64\Release\sdl.lib"
if not exist x64\Release\marblegame.exe exit /b 1
EOF
cmd.exe //c build.bat
- run:
name: Package app bundle
command: |