Skip to content

Commit 625bea8

Browse files
committed
add debug build option for emscripten.
1 parent 2fca135 commit 625bea8

1 file changed

Lines changed: 14 additions & 3 deletions

File tree

Makefile.emscripten

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
CXX := em++
2+
DEBUG ?= 0
3+
4+
ifeq ($(DEBUG),1)
5+
OPTFLAGS := -O0 -g3 -flto
6+
ASSERTIONS := 2
7+
DEBUG_EMFLAGS := -s SAFE_HEAP=1
8+
else
9+
OPTFLAGS := -O3 -flto
10+
ASSERTIONS := 0
11+
DEBUG_EMFLAGS :=
12+
endif
213

314
# Emscripten stuff
4-
EMFLAGS := --bind -s WASM=1 -s MODULARIZE=1 -s EXPORT_ES6=1 -s EXPORT_NAME="'TIVarsLib'" -s NO_EXIT_RUNTIME=1 -s ASSERTIONS=0 -s DISABLE_EXCEPTION_CATCHING=0 -s EXPORTED_RUNTIME_METHODS="['FS','getExceptionMessage','decrementExceptionRefcount']" --embed-file ti-toolkit-8x-tokens.xml
15+
EMFLAGS := --bind -s WASM=1 -s MODULARIZE=1 -s EXPORT_ES6=1 -s EXPORT_NAME="'TIVarsLib'" -s NO_EXIT_RUNTIME=1 -s ASSERTIONS=$(ASSERTIONS) -s DISABLE_EXCEPTION_CATCHING=0 -s EXPORTED_RUNTIME_METHODS="['FS','getExceptionMessage','decrementExceptionRefcount']" $(DEBUG_EMFLAGS) --embed-file ti-toolkit-8x-tokens.xml
516

6-
CXXFLAGS := -O3 -flto -std=c++2a -DTH_GDB_SUPPORT=1 -Ivendor/pugixml -W -Wall -Wextra
7-
LFLAGS := -flto $(EMFLAGS)
17+
CXXFLAGS := $(OPTFLAGS) -std=c++2a -DTH_GDB_SUPPORT=1 -Ivendor/pugixml -W -Wall -Wextra
18+
LFLAGS := $(OPTFLAGS) $(EMFLAGS)
819

920
SOURCES := $(wildcard src/*.cpp) $(wildcard src/TypeHandlers/*.cpp) vendor/pugixml/pugixml.cpp
1021

0 commit comments

Comments
 (0)