Skip to content

Commit da0f77c

Browse files
committed
Disable SDL2_mixer for emscripten builds
Remove SDL2_mixer from emscripten builds to fix compilation failure. The emscripten-ports/SDL2_mixer repository was archived in Jan 2024 and has unfixable compilation warnings in music_modplug.c. The port system internally enforces -sSTRICT -Werror which cannot be overridden by user flags like -sSTRICT=0. SDL2 (without mixer) still provides graphics support for games like Doom and Quake. Audio mixing is optional functionality.
1 parent 9764cff commit da0f77c

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

mk/wasm.mk

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,12 @@ CFLAGS += -mtail-call
1818

1919
# Build emscripten-port SDL
2020
ifeq ($(call has, SDL), 1)
21-
# Disable STRICT mode to avoid -Werror in SDL2_mixer port compilation.
22-
# The emscripten-ports/SDL2_mixer was archived in Jan 2024 and has warnings
23-
# in music_modplug.c that become fatal errors under STRICT mode.
24-
CFLAGS_emcc += -sSTRICT=0 -sUSE_SDL=2 -sSDL2_MIXER_FORMATS=wav,mid -sUSE_SDL_MIXER=2
21+
# NOTE: SDL2_mixer is disabled for emscripten builds because:
22+
# 1. The emscripten-ports/SDL2_mixer repository was archived in Jan 2024
23+
# 2. It has unfixable compilation warnings in music_modplug.c
24+
# 3. The port system internally enforces -sSTRICT -Werror which cannot be overridden
25+
# 4. Games (Doom/Quake) work without audio mixing, SDL2 alone provides graphics
26+
CFLAGS_emcc += -sUSE_SDL=2
2527
OBJS_EXT += syscall_sdl.o
2628
LDFLAGS += -pthread
2729
endif
@@ -32,7 +34,6 @@ CFLAGS_emcc += -sINITIAL_MEMORY=2GB \
3234
-s"EXPORTED_FUNCTIONS=$(EXPORTED_FUNCS)" \
3335
-sSTACK_SIZE=4MB \
3436
-sPTHREAD_POOL_SIZE=navigator.hardwareConcurrency \
35-
--embed-file build/timidity@/etc/timidity \
3637
-DMEM_SIZE=0x20000000 \
3738
-DCYCLE_PER_STEP=2000000 \
3839
-O3 \
@@ -63,7 +64,8 @@ $(OUT)/elf_list.js: artifact tools/gen-elf-list-js.py
6364
$(Q)tools/gen-elf-list-js.py > $@
6465

6566
# used to download all dependencies of elf executable and bundle into single wasm
66-
deps_emcc += artifact $(OUT)/elf_list.js $(DOOM_DATA) $(QUAKE_DATA) $(TIMIDITY_DATA)
67+
# NOTE: TIMIDITY_DATA removed because SDL2_mixer is disabled for emscripten
68+
deps_emcc += artifact $(OUT)/elf_list.js $(DOOM_DATA) $(QUAKE_DATA)
6769

6870
# check browser version if supports TCO
6971
CHROME_MAJOR :=

0 commit comments

Comments
 (0)