Skip to content

Commit

Permalink
Fix binaryen.js to include allocate() explicitly (#4793)
Browse files Browse the repository at this point in the history
binaryen.js uses allocate, which is no longer exported by default in emscripten
tip of tree builds.
  • Loading branch information
kripken committed Jul 11, 2022
1 parent 44fa122 commit e2ce69c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ if(EMSCRIPTEN)
target_link_libraries(binaryen_wasm "-s NODERAWFS=0")
target_link_libraries(binaryen_wasm "-s EXPORT_NAME=Binaryen")
target_link_libraries(binaryen_wasm "-s EXPORT_ES6=1")
target_link_libraries(binaryen_wasm "-sEXPORTED_RUNTIME_METHODS=allocate")
target_link_libraries(binaryen_wasm "--post-js ${CMAKE_CURRENT_SOURCE_DIR}/src/js/binaryen.js-post.js")
target_link_libraries(binaryen_wasm "--extern-pre-js ${CMAKE_CURRENT_SOURCE_DIR}/src/js/binaryen.js-extern-pre.js")
target_link_libraries(binaryen_wasm optimized "--closure 1")
Expand Down Expand Up @@ -439,6 +440,7 @@ if(EMSCRIPTEN)
else()
target_link_libraries(binaryen_js "-s EXPORT_ES6=1")
endif()
target_link_libraries(binaryen_js "-sEXPORTED_RUNTIME_METHODS=allocate")
target_link_libraries(binaryen_js "--post-js ${CMAKE_CURRENT_SOURCE_DIR}/src/js/binaryen.js-post.js")
# js_of_ocaml needs a specified variable with special comment to provide the library to consumers
if(JS_OF_OCAML)
Expand Down

0 comments on commit e2ce69c

Please sign in to comment.