From 192b5c995b26d6226fe930ced888092bcbced8d6 Mon Sep 17 00:00:00 2001 From: Turtle Dove Date: Tue, 14 Jul 2026 23:29:27 -0500 Subject: [PATCH] =?UTF-8?q?ci:=20Fix=20WASM=20build=20=E2=80=94=20sed=20th?= =?UTF-8?q?e=20Makefile=20instead=20of=20passing=20LDFLAGS=20on=20CLI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The make command was failing because LDFLAGS+='' doesn't properly override the Makefile's appended flags. Instead, use sed to: 1. Replace shell_minimal.html with shell_imgui_xl.html 2. Uncomment the -sSINGLE_FILE line Also added keep_files: true and destination_dir: wasm to the deploy step so the existing gh-pages content is preserved. --- .github/workflows/deploy-wasm.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/deploy-wasm.yml b/.github/workflows/deploy-wasm.yml index 994632315..0aa395e03 100644 --- a/.github/workflows/deploy-wasm.yml +++ b/.github/workflows/deploy-wasm.yml @@ -46,12 +46,18 @@ jobs: source ./emsdk_env.sh popd - # Build with custom shell, single-file output (everything embedded in one .html) - make -C examples/example_sdl2_opengl3 -f Makefile.emscripten \ - LDFLAGS+="-sSINGLE_FILE --shell-file ../libs/emscripten/shell_imgui_xl.html" + # Build with custom shell file (single-file mode: all WASM embedded in one .html) + # We sed the Makefile to use our custom shell and enable SINGLE_FILE + cd examples/example_sdl2_opengl3 + sed -i 's|--shell-file ../libs/emscripten/shell_minimal.html|--shell-file ../libs/emscripten/shell_imgui_xl.html|' Makefile.emscripten + sed -i 's|#LDFLAGS += -sSINGLE_FILE|LDFLAGS += -sSINGLE_FILE|' Makefile.emscripten + make -f Makefile.emscripten -j$(nproc) # Verify output - ls -la examples/example_sdl2_opengl3/web/ + echo "=== Build output ===" + ls -la web/ + echo "=== File size ===" + du -sh web/index.html - name: Deploy to gh-pages uses: peaceiris/actions-gh-pages@v4