Skip to content

Commit 0de5195

Browse files
committed
feat!: Upgrade to Binaryen v128
1 parent a338977 commit 0de5195

41 files changed

Lines changed: 805 additions & 568 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/js.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,17 @@ jobs:
4040
with:
4141
submodules: "recursive"
4242

43+
- name: Patch binaryen
44+
run: |
45+
git apply ./binaryen.patch
46+
4347
- name: "Build binaryen.es5.js"
4448
run: |
4549
mkdir ./binaryen/build
4650
cd ./binaryen/build
4751
source $HOME/emsdk/emsdk_env.sh
4852
emcc --version
49-
emcmake cmake .. -DCMAKE_BUILD_TYPE=Release -DJS_OF_OCAML=ON -DBUILD_TOOLS=OFF -DBUILD_TESTS=OFF
53+
emcmake cmake .. -DCMAKE_BUILD_TYPE=Release -DEMSCRIPTEN_ENABLE_SINGLE_FILE=ON -DJS_OF_OCAML=ON -DBUILD_TOOLS=OFF -DBUILD_TESTS=OFF
5054
emmake make -j2 binaryen_js
5155
cd ../..
5256
mv ./binaryen/build/bin/binaryen_js.js binaryen.es5.js

binaryen

Submodule binaryen updated 293 files

binaryen.patch

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
--- a/binaryen/CMakeLists.txt
2+
+++ b/binaryen/CMakeLists.txt
3+
@@ -550,8 +550,8 @@ if(EMSCRIPTEN)
4+
if(JS_OF_OCAML)
5+
# js_of_ocaml needs a specified variable with special comment to provide the library to consumer
6+
target_link_libraries(binaryen_js PRIVATE "--extern-pre-js=${CMAKE_CURRENT_SOURCE_DIR}/src/js/binaryen.jsoo-extern-pre.js")
7+
- # Currently, js_of_ocaml can only process ES5 code
8+
- target_link_libraries(binaryen_js PRIVATE optimized "--closure-args=\"--language_out=ECMASCRIPT5\"")
9+
+ # js_of_ocaml does not support top level await
10+
+ target_link_libraries(binaryen_js PRIVATE "-sWASM_ASYNC_COMPILATION=0")
11+
else()
12+
target_link_libraries(binaryen_js PRIVATE "-sEXPORT_ES6")
13+
endif()

dune

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,3 +138,5 @@
138138
-DCMAKE_INSTALL_PREFIX=binaryen)
139139
(run cmake --build binaryen --config Release -- -j4)
140140
(copy binaryen/bin/libbinaryen.dll dllbinaryen.dll)))))
141+
142+
(data_only_dirs node_modules)

0 commit comments

Comments
 (0)