summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2022-07-11 13:00:48 -0700
committerGitHub <noreply@github.com>2022-07-11 20:00:48 +0000
commite2ce69c1d1ea634cd97599bd28fecc2a9b48e9af (patch)
treee9bb68e96657cf82cd508ac074bbc57b952a03a4 /CMakeLists.txt
parent44fa122bec913d66bc3ce1271bf4f63f6d5d31f2 (diff)
downloadbinaryen-e2ce69c1d1ea634cd97599bd28fecc2a9b48e9af.tar.gz
binaryen-e2ce69c1d1ea634cd97599bd28fecc2a9b48e9af.tar.bz2
binaryen-e2ce69c1d1ea634cd97599bd28fecc2a9b48e9af.zip
Fix binaryen.js to include allocate() explicitly (#4793)
binaryen.js uses allocate, which is no longer exported by default in emscripten tip of tree builds.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt2
1 files changed, 2 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 53c511baf..41c742943 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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")
@@ -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)