Skip to content

Commit

Permalink
feat: Provide binaryen.js with library (#48)
Browse files Browse the repository at this point in the history
chore: Restrict dune to <3
chore: Add js_of_ocaml-compiler
chore: Add smoketest for JS foreigns
chore: Update README for workaround
chore: Disable JS test on Windows
  • Loading branch information
phated committed Mar 9, 2022
1 parent 78c2bb5 commit f389527
Show file tree
Hide file tree
Showing 35 changed files with 1,123 additions and 852 deletions.
16 changes: 16 additions & 0 deletions README.md
Expand Up @@ -77,6 +77,22 @@ If you are planning to create portable binaries for Windows, it will try to find

These flags might not work on other operating systems (like MacOS), so you'll probably need to use `dune-configurator` to vary the flags per platform. You can see an example of this in our [tests/](./tests/dune).

## JavaScript

When compiling to JavaScript with `js_of_ocaml`, you'll need to add the `--disable share` flag. This is needed until we can depend on the bug fix from [ocsigen/js_of_ocaml#1249](https://github.com/ocsigen/js_of_ocaml/pull/1249). In the meantime, you can change your dune file:

```diff
(executable
(name example)
(public_name example)
(modes
(byte js))
+ (js_of_ocaml
+ (flags --disable share))
(modules example)
(libraries binaryen))
```

## Contributing

You'll need Node.js and [`esy`](https://esy.sh/docs/en/getting-started.html#install-esy) to build this project.
Expand Down
367 changes: 367 additions & 0 deletions binaryen.es5.js

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion dune
Expand Up @@ -3,7 +3,9 @@
(public_name libbinaryen.c)
(foreign_archives binaryen)
(c_library_flags :standard -lstdc++ -lpthread)
(install_c_headers binaryen-c))
(install_c_headers binaryen-c)
(js_of_ocaml
(javascript_files binaryen.es5.js)))

(install
(section lib)
Expand Down
582 changes: 351 additions & 231 deletions esy.lock/index.json

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

54 changes: 54 additions & 0 deletions esy.lock/opam/js_of_ocaml-compiler.3.11.0/opam

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 39 additions & 0 deletions esy.lock/opam/ocaml-compiler-libs.v0.12.4/opam

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions esy.lock/opam/ocamlformat.0.20.1/opam

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f389527

Please sign in to comment.