Add web target to SDL example (without SDL3 files)

This commit is contained in:
Lexi / Zoe 2025-10-18 00:56:19 +02:00
parent c9ffc52ee4
commit ab0163e60f
Signed by: binaryDiv
GPG Key ID: F8D4956E224DA232
4 changed files with 18 additions and 0 deletions

View File

@ -2,3 +2,7 @@
/build
/build.ninja
/shuriken.override.yaml
# SDL3 files
/lib
/vendor

View File

View File

@ -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

0
examples/sdl_app/vendor/.gitkeep vendored Normal file
View File