Skip to content

Commit

Permalink
Ensure emnapiInit function is exported
Browse files Browse the repository at this point in the history
Prevents latest emscripten optimising it away
  • Loading branch information
lovell committed Aug 12, 2024
1 parent de42667 commit ad36fa0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/binding.gyp
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@
'-Oz',
'-sALLOW_MEMORY_GROWTH',
'-sENVIRONMENT=node',
'-sEXPORTED_FUNCTIONS=["_vips_shutdown", "_uv_library_shutdown"]',
'-sEXPORTED_FUNCTIONS=["emnapiInit", "_vips_shutdown", "_uv_library_shutdown"]',
'-sNODERAWFS',
'-sTEXTDECODER=0',
'-sWASM_ASYNC_COMPILATION=0',
Expand Down
6 changes: 3 additions & 3 deletions src/emscripten/common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
'default_configuration': 'Release',
'type': 'executable',
'cflags': [
'-pthread',
'-sDEFAULT_TO_CXX=0'
'-pthread'
],
'cflags_cc': [
'-pthread'
Expand All @@ -19,6 +18,7 @@
'--js-library=<!(node -p "require(\'emnapi\').js_library")',
'-sAUTO_JS_LIBRARIES=0',
'-sAUTO_NATIVE_LIBRARIES=0',
'-sDEFAULT_TO_CXX=0',
'-sNODEJS_CATCH_EXIT=0',
'-sNODEJS_CATCH_REJECTION=0'
],
Expand All @@ -28,7 +28,7 @@
'EMNAPI_WORKER_POOL_SIZE=1'
],
'include_dirs': [
'<!(node -p "require(\'emnapi\').include")'
'<!(node -p "require(\'emnapi\').include_dir")'
],
'sources': [
'<!@(node -p "require(\'emnapi\').sources.map(x => JSON.stringify(path.relative(process.cwd(), x))).join(\' \')")'
Expand Down

0 comments on commit ad36fa0

Please sign in to comment.