Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/esy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref || github.run_id }}
cancel-in-progress: true

env:
ESY__PREFIX: ${{ github.workspace }}/.esy/

jobs:
build:
name: Build and test
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,17 @@ jobs:
with:
submodules: "recursive"

- name: Patch binaryen
run: |
git apply ./binaryen.patch

- name: "Build binaryen.es5.js"
run: |
mkdir ./binaryen/build
cd ./binaryen/build
source $HOME/emsdk/emsdk_env.sh
emcc --version
emcmake cmake .. -DCMAKE_BUILD_TYPE=Release -DJS_OF_OCAML=ON -DBUILD_TOOLS=OFF -DBUILD_TESTS=OFF
emcmake cmake .. -DCMAKE_BUILD_TYPE=Release -DEMSCRIPTEN_ENABLE_SINGLE_FILE=ON -DJS_OF_OCAML=ON -DBUILD_TOOLS=OFF -DBUILD_TESTS=OFF
emmake make -j2 binaryen_js
cd ../..
mv ./binaryen/build/bin/binaryen_js.js binaryen.es5.js
Expand Down
2 changes: 1 addition & 1 deletion binaryen
Submodule binaryen updated 293 files
773 changes: 374 additions & 399 deletions binaryen.es5.js

Large diffs are not rendered by default.

13 changes: 13 additions & 0 deletions binaryen.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- a/binaryen/CMakeLists.txt
+++ b/binaryen/CMakeLists.txt
@@ -550,8 +550,8 @@ if(EMSCRIPTEN)
if(JS_OF_OCAML)
# js_of_ocaml needs a specified variable with special comment to provide the library to consumer
target_link_libraries(binaryen_js PRIVATE "--extern-pre-js=${CMAKE_CURRENT_SOURCE_DIR}/src/js/binaryen.jsoo-extern-pre.js")
- # Currently, js_of_ocaml can only process ES5 code
- target_link_libraries(binaryen_js PRIVATE optimized "--closure-args=\"--language_out=ECMASCRIPT5\"")
+ # js_of_ocaml does not support top level await
+ target_link_libraries(binaryen_js PRIVATE "-sWASM_ASYNC_COMPILATION=0")
else()
target_link_libraries(binaryen_js PRIVATE "-sEXPORT_ES6")
endif()
2 changes: 2 additions & 0 deletions dune
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,5 @@
-DCMAKE_INSTALL_PREFIX=binaryen)
(run cmake --build binaryen --config Release -- -j4)
(copy binaryen/bin/libbinaryen.dll dllbinaryen.dll)))))

(data_only_dirs node_modules)
Loading
Loading