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.
This commit is contained in:
kichikuou
2026-09-15 20:37:08 +09:00
parent c10a8aa60e
commit d18abe1125
40 changed files with 1462 additions and 238 deletions
+11 -5
View File
@@ -8,6 +8,10 @@ env:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
sdl-version: [2, 3]
name: Emscripten SDL${{ matrix.sdl-version }}
steps:
- uses: actions/checkout@v6
@@ -32,9 +36,11 @@ jobs:
- name: Build
run: |
mkdir -p out/wasm
cd out/wasm
emcmake cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_COMPILE_WARNING_AS_ERROR=YES ../../
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/
@@ -42,5 +48,5 @@ jobs:
- name: Upload artifacts
uses: actions/upload-artifact@v7
with:
name: system3-wasm
path: out/wasm/system3
name: system3-wasm-sdl${{ matrix.sdl-version }}
path: out/wasm-sdl${{ matrix.sdl-version }}/system3