diff --git a/examples/sdl_app/.gitignore b/examples/sdl_app/.gitignore index 75c3626..781f441 100644 --- a/examples/sdl_app/.gitignore +++ b/examples/sdl_app/.gitignore @@ -2,3 +2,7 @@ /build /build.ninja /shuriken.override.yaml + +# SDL3 files +/lib +/vendor diff --git a/examples/sdl_app/lib/web/.gitkeep b/examples/sdl_app/lib/web/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/examples/sdl_app/shuriken.yaml b/examples/sdl_app/shuriken.yaml index 830efb4..9f3282e 100644 --- a/examples/sdl_app/shuriken.yaml +++ b/examples/sdl_app/shuriken.yaml @@ -8,3 +8,17 @@ default_target: linux targets: linux: output_file: sdl_example + + # NOTE: To build for web, you need a) emscripten installed on your system, b) the SDL3 and SDL3_image headers in the + # vendor directory, and c) static libraries for SDL3 and SDL3_image compiled for WebAssembly in the lib directory. + # These are not contained in this repository to keep the repository data small. + web: + cpp_compiler: em++ + cpp_flags_extra: -Ivendor + linker_args: >- + lib/web/libSDL3.a + lib/web/libSDL3_image.a + --use-preload-plugins + --preload-file assets/ + output_file: output/index.html + run_command: python -m http.server -d build/web/output diff --git a/examples/sdl_app/vendor/.gitkeep b/examples/sdl_app/vendor/.gitkeep new file mode 100644 index 0000000..e69de29