Skip to content

Commit 649d850

Browse files
committed
fix: support c++ exceptions
1 parent 26fd7c9 commit 649d850

File tree

1 file changed

+14
-15
lines changed

1 file changed

+14
-15
lines changed

Makefile

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -56,22 +56,21 @@ $(OUT_FILES): $(LIBPG_QUERY_DIR) $(SRC_FILES)
5656
ifdef EMSCRIPTEN
5757
@ $(CXX) \
5858
$(CXXFLAGS) \
59-
-D NAPI_DISABLE_CPP_EXCEPTIONS \
60-
-D NODE_ADDON_API_ENABLE_MAYBE \
61-
-D NAPI_HAS_THREADS \
62-
-I $(LIBPG_QUERY_DIR) \
63-
-I ./node_modules/emnapi/include \
64-
-I ./node_modules/node-addon-api \
65-
-L ./node_modules/emnapi/lib/wasm32-emscripten \
66-
-L $(LIBPG_QUERY_DIR) \
59+
-DNAPI_HAS_THREADS \
60+
-I$(LIBPG_QUERY_DIR) \
61+
-I./node_modules/emnapi/include \
62+
-I./node_modules/node-addon-api \
63+
-L./node_modules/emnapi/lib/wasm32-emscripten \
64+
-L$(LIBPG_QUERY_DIR) \
6765
--js-library=./node_modules/emnapi/dist/library_napi.js \
68-
-s EXPORTED_FUNCTIONS="['_malloc','_free','_napi_register_wasm_v1','_node_api_module_get_api_version_v1']" \
69-
-s EXPORT_NAME="$(WASM_MODULE_NAME)" \
70-
-s ENVIRONMENT="web" \
71-
-s MODULARIZE=1 \
72-
-s EXPORT_ES6=1 \
73-
-l pg_query \
74-
-l emnapi-basic \
66+
-sEXPORTED_FUNCTIONS="['_malloc','_free','_napi_register_wasm_v1','_node_api_module_get_api_version_v1']" \
67+
-sEXPORT_NAME="$(WASM_MODULE_NAME)" \
68+
-sENVIRONMENT="web" \
69+
-sMODULARIZE=1 \
70+
-sEXPORT_ES6=1 \
71+
-fexceptions \
72+
-lpg_query \
73+
-lemnapi-basic \
7574
-o $@ \
7675
$(SRC_FILES)
7776
else

0 commit comments

Comments
 (0)