mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-09-22 22:58:12 +03:00
Add optional SDL3 support while keeping SDL2 as the default. SDL3 builds must be selected explicitly with the SYSTEM3_SDL_VERSION CMake option. Centralize most SDL2/SDL3 API differences behind compatibility interfaces. Audio playback uses a dedicated SDL3 backend based on SDL3 audio streams, implemented separately in mako_sdl3.cpp. Android and Nintendo Switch remain on SDL2 for now.
53 lines
1.3 KiB
YAML
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
|