From c83e6831eac8579f9b7c63d37fa3990dae24c5a6 Mon Sep 17 00:00:00 2001 From: sergeypdev Date: Wed, 28 May 2025 11:41:47 +0400 Subject: [PATCH] Conditionally pass debug flag to emcc --- builder/builder.odin | 40 ++++++++++++++++++++++------------------ 1 file changed, 22 insertions(+), 18 deletions(-) diff --git a/builder/builder.odin b/builder/builder.odin index c839edc..90c1235 100644 --- a/builder/builder.odin +++ b/builder/builder.odin @@ -337,25 +337,29 @@ main :: proc() { ) run_cmd(cmd, "") + wasm_debug_flag := opts.debug ? []string{"-g"} : []string{} + run_cmd( - { - "emcc" + EMSCRIPTEN_SHELL_EXT, - "-g", - "-o", - "bin/web/index.html", - "bin/web/game.wasm.o", - "libs/raylib/zig-out-static/lib/libraylib.a", - "libs/physfs/build/libphysfs.a", - "-sUSE_GLFW=3", - "-sWASM_BIGINT", - "-sWARN_ON_UNDEFINED_SYMBOLS=0", - "-sALLOW_MEMORY_GROWTH", - "-sASSERTIONS", - "--shell-file", - "main_web/index_template.html", - "--preload-file", - "assets", - }, + temp_concat( + { + "emcc" + EMSCRIPTEN_SHELL_EXT, + "-o", + "bin/web/index.html", + "bin/web/game.wasm.o", + "libs/raylib/zig-out-static/lib/libraylib.a", + "libs/physfs/build/libphysfs.a", + "-sUSE_GLFW=3", + "-sWASM_BIGINT", + "-sWARN_ON_UNDEFINED_SYMBOLS=0", + "-sALLOW_MEMORY_GROWTH", + "-sASSERTIONS", + "--shell-file", + "main_web/index_template.html", + "--preload-file", + "assets", + }, + wasm_debug_flag, + ), "", ) remove_file("./bin/web/game.wasm.o")