Skip to content

Commit

Permalink
docs: add section about static linking (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Nov 25, 2020
1 parent a320807 commit f9afda1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Expand Up @@ -42,6 +42,22 @@ This project aims to provide full feature parity with the [Binaryen C API](https

None of these are particularly challenging to create bindings for—they just haven't been written yet. If you need anything that's missing, feel free to open a PR.

## Static Linking

If you are planning to create portable binaries for Windows, it will try to find Cygwin/MinGW locations in your `PATH`. To avoid this, you probably want to add this to your `(executable)` stanzas:

```diff
(executable
(name example)
(public_name example)
(package example)
+ (flags (:standard -ccopt -- -ccopt -static))
(modules example)
(libraries binaryen))
```

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.

## Contributing

After cloning the repository, be sure to initialize the Binaryen submodule:
Expand Down

0 comments on commit f9afda1

Please sign in to comment.