Windows instructions
laanwj opened this issue · comments
After having converted the build system to meson, and reducing the build-time dependencies to just SDL2 (for the non-debugger build), it should be more straightforward to do a windows build.
I don't know windows development myself, so could use some help here.
At least the CI tests pass on Windows now. Shouldn't be too hard to build an .exe
.
These steps seem sufficient to build a Windows binary with github actions, with MSVC:
windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Prepare MSVC
uses: bus1/cabuild/action/msdevshell@v1
with:
architecture: x64
- run: pip install meson ninja
- run: |
mkdir subprojects
meson wrap install sdl2
- run: meson setup --buildtype release -Dgame_cheats=true -Ddebug_ui=true builddir/
- run: ninja -C builddir
- run: meson test -C builddir/ -v
- uses: actions/upload-artifact@v3
if: failure()
with:
name: Windows_Meson_Testlog
path: builddir/meson-logs/testlog.txt
- uses: actions/upload-artifact@v3
with:
name: Windows_Executable
path: builddir/src/sundog.exe
Then you can download the artifact and run sundog.exe <disk_image>
(or copy sundog.st
to the directory of the exe).
- If you get an error about missing DLLs, make sure you have the appropriate VC redistributable installed (and double-check you're building in release mode, not debug mode).
- If you get an error about not being able to initialize GL driver, your WGL driver doesn't have native support for OpenGL ES 2/3. You'll need to copy the ANGLE DLLs (
libEGL.dll
libGLESv2.dll
andd3dcompiler_XX.dll)
) to the current directory before running. You can build them yourself or copy them from a Google Chrome/Chromium distribution.
Some notes on building a binary release
-
Instead of building and statically linking SDL, link against and ship the official release DLLs. This makes sure we don't inherit bugs from bleeding-edge SDL, and speeds up the build.
-
I can't find any (trustable) download of just the ANGLE DLLs, that could be used to create a release. Here's a github action that builds it, might be useful for buliding a release: https://github.com/xiaozhuai/angle_builds
However it's broken right now, due to a missing option while downloading the windows SDL: https://github.com/xiaozhuai/angle_builds/pull/2
Another possibility may be to build it usingvcpkg install angle:x64-windows
.