Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows instructions #21

Open
laanwj opened this issue Jan 28, 2023 · 3 comments
Open

Windows instructions #21

laanwj opened this issue Jan 28, 2023 · 3 comments

Comments

@laanwj
Copy link
Owner

laanwj commented Jan 28, 2023

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.

@laanwj
Copy link
Owner Author

laanwj commented Jan 28, 2023

At least the CI tests pass on Windows now. Shouldn't be too hard to build an .exe.

@laanwj
Copy link
Owner Author

laanwj commented Jan 29, 2023

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 and d3dcompiler_XX.dll)) to the current directory before running. You can build them yourself or copy them from a Google Chrome/Chromium distribution.

@laanwj laanwj changed the title Windows build? Windows instructions Jan 29, 2023
@laanwj
Copy link
Owner Author

laanwj commented Jan 31, 2023

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 using vcpkg install angle:x64-windows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant