From f2169ed0b4b7dc60ab3b825b31353cdeea45bd21 Mon Sep 17 00:00:00 2001 From: James Darpinian Date: Fri, 7 Jun 2024 08:28:09 -0700 Subject: [PATCH] Support debug Emscripten build --- Makefile | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9d73264f..f6e4a11e 100644 --- a/Makefile +++ b/Makefile @@ -1118,6 +1118,10 @@ ifeq ($(PLATFORM),emscripten) # Some of these warnings may actually be legit problems and should be fixed at some point. BASE_CFLAGS+=-Wno-deprecated-non-prototype -Wno-dangling-else -Wno-implicit-const-int-float-conversion -Wno-misleading-indentation -Wno-format-overflow -Wno-logical-not-parentheses -Wno-absolute-value + DEBUG_CFLAGS=-g3 -O0 # -fsanitize=address -fsanitize=undefined + # Emscripten needs debug compiler flags to be passed to the linker as well + DEBUG_LDFLAGS=$(DEBUG_CFLAGS) + SHLIBEXT=wasm SHLIBCFLAGS=-fPIC SHLIBLDFLAGS=-s SIDE_MODULE @@ -1506,7 +1510,8 @@ all: debug release debug: @$(MAKE) targets B=$(BD) CFLAGS="$(CFLAGS) $(BASE_CFLAGS) $(DEPEND_CFLAGS)" \ OPTIMIZE="$(DEBUG_CFLAGS)" OPTIMIZEVM="$(DEBUG_CFLAGS)" \ - CLIENT_CFLAGS="$(CLIENT_CFLAGS)" SERVER_CFLAGS="$(SERVER_CFLAGS)" V=$(V) + CLIENT_CFLAGS="$(CLIENT_CFLAGS)" SERVER_CFLAGS="$(SERVER_CFLAGS)" V=$(V) \ + LDFLAGS="$(LDFLAGS) $(DEBUG_LDFLAGS)" release: @$(MAKE) targets B=$(BR) CFLAGS="$(CFLAGS) $(BASE_CFLAGS) $(DEPEND_CFLAGS)" \