This repo is for automating the build of WebAssembly (WASM) native libraries for FNA and MonoGame, including:
- SDL3.a - Simple DirectMedia Layer.
- SDL2.a - Simple DirectMedia Layer (via sdl2-compat)
- FNA3D.a - 3D graphics library for FNA.
- FAudio.a - XAudio reimplementation for FNA.
- openssl - OpenSSL WASM.
- libgdiplus.a / System.Drawing - Mono GDI+ / System.Drawing for WASM.
liba+hot_reload_detour- Library used for MonoMod on WASM.- dotnet - Patched dotnet wasm multithreaded runtime for MonoMod on WASM.
There is currently just one workflow:
- WASM Build (FNA).
This fork contains a few patches (and uses SDL3 as the base):
SDL3.patchfixes some issues withEM_ASMnot being proxied to main thread.SDL2.patch(for sdl2-compat) andSDL3-SDL2.patch(for sdl3) to build a cursed static build of sdl2-compatFNA3D.patchadds-pthreadto theCFLAGSso FNA3D is built with WASM threads support.dotnet.patchpatches the dotnet runtime so MonoMod can be used.glib.patchdisables gio, fuzzing, tools, and docs subdirectories in glib to allow building for WASM without unsupported dependencies.
Go to the Actions tab and download the .zip artifact from the latest workflow run.
See for further details: https://gist.github.com/TheSpydog/e94c8c23c01615a5a3b2cc1a0857415c (out of date)
The workflow also produces emsdk-frozen.zip (pthread=true build). This archive is a frozen copy of
src/mono/browser/emsdk from the patched runtime build, including dotnet-style emsdk_env and .emscripten
configuration. It is intended for consumers that need emsdk behavior to match dotnet runtime packaging.
For local generation after building runtime in liba/runtime:
./freeze-emsdk.sh ./liba/runtime ./Binaries/emsdk-frozen.zip