Files
kichikuou_system3-sdl2/.github/workflows/emscripten.yml
T
kichikuou d18abe1125 Add SDL3 support alongside SDL2
Centralize the differences between SDL2 and SDL3 behind compatibility
interfaces and select the appropriate implementations with the
SYSTEM3_SDL_VERSION CMake option. Android remains on SDL2 for now.
2026-09-15 20:37:08 +09:00

53 lines
1.3 KiB
YAML

name: Emscripten Build
on: [push, pull_request]
env:
EM_VERSION: latest
EM_CACHE_FOLDER: 'emsdk-cache'
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
sdl-version: [2, 3]
name: Emscripten SDL${{ matrix.sdl-version }}
steps:
- uses: actions/checkout@v6
with:
submodules: true
- name: Setup cache
id: cache-system-libraries
uses: actions/cache@v5
with:
path: ${{env.EM_CACHE_FOLDER}}
key: ${{env.EM_VERSION}}-${{ runner.os }}
- name: Setup Emscripten toolchain
uses: emscripten-core/setup-emsdk@v16
with:
version: ${{ env.EM_VERSION }}
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
- name: Work around emscripten-core/emscripten#26534
run: npm install -g typescript@5
- name: Build
run: |
mkdir -p out/wasm-sdl${{ matrix.sdl-version }}
cd out/wasm-sdl${{ matrix.sdl-version }}
emcmake cmake -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_COMPILE_WARNING_AS_ERROR=YES \
-DSYSTEM3_SDL_VERSION=${{ matrix.sdl-version }} ../..
make -j4
mkdir system3
mv system3.* system3/
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: system3-wasm-sdl${{ matrix.sdl-version }}
path: out/wasm-sdl${{ matrix.sdl-version }}/system3