Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md How to build wasmtime-c-api #205

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
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
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,16 +131,17 @@ Next up you'll want to have a [local Wasmtime build
available](https://bytecodealliance.github.io/wasmtime/contributing-building.html).

You'll need to build at least the `wasmtime-c-api` crate, which, at the time of
this writing, would be:
this writing, would be (apple m1 example):

```sh
$ cargo build -p wasmtime-c-api
$ rustup target add aarch64-apple-darwin
$ cargo build --release --target aarch64-apple-darwin -p wasmtime-c-api
```

Once you've got that you can set up the environment of this library with:
Once you've got that you can set up the environment of this library with (apple m1 example):

```sh
$ ./ci/local.sh /path/to/wasmtime
$ ./ci/local.sh /path/to/wasmtime aarch64-apple-darwin
```

This will create a `build` directory which has the compiled libraries and header
Expand Down
5 changes: 3 additions & 2 deletions ci/local.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/bin/bash

wasmtime=$1
target=$2
if [ "$wasmtime" = "" ]; then
echo "must pass path to wasmtime"
exit 1
Expand All @@ -15,9 +16,9 @@ for d in "include" "include/wasmtime" "linux-x86_64" "macos-x86_64" "windows-x86
echo "package ${name/-/_}" > "$path/empty.go"
done

build="$wasmtime/target/release"
build="$wasmtime/target/"$target"/release"
if [ ! -d "$build" ]; then
build="$wasmtime/target/debug"
build="$wasmtime/target/"$target"/debug"
fi
# Use absolute path for symbolic links
build=$(cd "$build" && pwd)
Expand Down
Loading