File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -100,16 +100,14 @@ if(ZMQ_WASM OR CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
100100 # export an indirect function table for napi-wasm
101101 add_link_options ("--export-table" )
102102
103- add_compile_options ("-fwasm-exceptions" )
104-
105103 # Add WebAssembly-specific exports for napi-wasm
106104 add_link_options ("SHELL:-s EXPORTED_FUNCTIONS=['_malloc','_free','_napi_register_wasm_v1']" )
107105 add_link_options ("SHELL:-s EXPORTED_RUNTIME_METHODS=['ccall','cwrap']" )
108106 add_link_options ("SHELL:-s ALLOW_MEMORY_GROWTH=1" )
109-
110- # Allow undefined symbols on Linux for runtime loading
107+ add_link_options ("SHELL:-s ENVIRONMENT='node'" )
111108 add_link_options ("SHELL:-s ERROR_ON_UNDEFINED_SYMBOLS=0" )
112- add_link_options ("SHELL:-Wl,--unresolved-symbols=ignore-all" )
109+ add_link_options ("SHELL:-s DISABLE_EXCEPTION_CATCHING=0" )
110+ add_link_options ("--no-entry" )
113111endif ()
114112
115113# Set MacOS deployment target
@@ -162,6 +160,7 @@ project_options(
162160 ENABLE_CACHE
163161 ENABLE_COMPILE_COMMANDS_SYMLINK
164162 ${ENABLE_SANITIZER_UNDEFINED}
163+ ENABLE_INTERPROCEDURAL_OPTIMIZATION
165164)
166165
167166file (GLOB_RECURSE SOURCES "./src/*.cc" "./src/*.cpp" )
Original file line number Diff line number Diff line change @@ -24,7 +24,8 @@ async function main() {
2424 const wasm = await getWasm ( )
2525
2626 const { instance} = await WebAssembly . instantiate ( wasm , {
27- env : napi ,
27+ napi : napi ,
28+ env : { } // The env imports will be provided by napi-wasm
2829 } )
2930
3031 // Create an environment.
You can’t perform that action at this time.
0 commit comments