File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,9 @@ option(BUILD_EMSCRIPTEN_TOOLS_ONLY "Build only tools needed by emscripten" OFF)
46
46
# Turn this on to build binaryen.js as ES5, with additional compatibility configuration for js_of_ocaml.
47
47
option (JS_OF_OCAML "Build binaryen.js for js_of_ocaml" OFF )
48
48
49
+ # Turn this on to use the Wasm EH feature instead of emscripten EH in the wasm/BinaryenJS builds
50
+ option (EMSCRIPTEN_ENABLE_WASM_EH "Enable Wasm EH feature in emscripten build" OFF )
51
+
49
52
# For git users, attempt to generate a more useful version string
50
53
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR} /.git )
51
54
find_package (Git QUIET REQUIRED )
@@ -313,8 +316,12 @@ if(EMSCRIPTEN)
313
316
endif ()
314
317
315
318
add_link_flag ("-sALLOW_MEMORY_GROWTH" )
316
- add_compile_flag ("-sDISABLE_EXCEPTION_CATCHING=0" )
317
- add_link_flag ("-sDISABLE_EXCEPTION_CATCHING=0" )
319
+ if (EMSCRIPTEN_ENABLE_WASM_EH )
320
+ add_compile_flag ("-fwasm-exceptions" )
321
+ else ()
322
+ add_compile_flag ("-sDISABLE_EXCEPTION_CATCHING=0" )
323
+ add_link_flag ("-sDISABLE_EXCEPTION_CATCHING=0" )
324
+ endif ()
318
325
# make the tools immediately usable on Node.js
319
326
add_link_flag ("-sNODERAWFS" )
320
327
# in opt builds, LTO helps so much (>20%) it's worth slow compile times
Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ def test(cmd):
60
60
test ([shared .MOZJS , '-m' , 'a.mjs' ])
61
61
if shared .NODEJS :
62
62
if node_has_wasm or 'WebAssembly.' not in test_src :
63
- test ([shared .NODEJS , 'a.mjs' ])
63
+ test ([shared .NODEJS , '--experimental-wasm-eh' , ' a.mjs' ])
64
64
else :
65
65
print ('Skipping ' + test_path + ' because WebAssembly might not be supported' )
66
66
You can’t perform that action at this time.
0 commit comments