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

Add basic macOS arm64 support #102

Merged
merged 1 commit into from
Oct 1, 2021
Merged
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
1 change: 1 addition & 0 deletions build/macos-aarch64/empty.go
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package macos_aarch64
8 changes: 5 additions & 3 deletions ci/local.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fi

# Clean and re-create "build" directory hierarchy
rm -rf build
for d in "include" "include/wasmtime" "linux-x86_64" "macos-x86_64" "windows-x86_64"; do
for d in "include" "include/wasmtime" "linux-x86_64" "macos-x86_64" "windows-x86_64" "macos-aarch64"; do
path="build/$d"
mkdir -p "$path"
name=$(basename $d)
Expand All @@ -26,8 +26,10 @@ if [ ! -f "$build/libwasmtime.a" ]; then
echo 'Missing libwasmtime.a. Did you `cargo build -p wasmtime-c-api`?'
fi

ln -s "$build/libwasmtime.a" build/linux-x86_64/libwasmtime.a
ln -s "$build/libwasmtime.a" build/macos-x86_64/libwasmtime.a
for d in "linux-x86_64" "macos-x86_64" "macos-aarch64"; do
ln -s "$build/libwasmtime.a" "build/$d/libwasmtime.a"
done

cp "$wasmtime"/crates/c-api/include/*.h build/include
cp -r "$wasmtime"/crates/c-api/include/wasmtime build/include
cp "$wasmtime"/crates/c-api/wasm-c-api/include/*.h build/include
1 change: 1 addition & 0 deletions ffi.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package wasmtime
// #cgo linux,amd64 LDFLAGS:-L${SRCDIR}/build/linux-x86_64
// #cgo linux,arm64 LDFLAGS:-L${SRCDIR}/build/linux-aarch64
// #cgo darwin,amd64 LDFLAGS:-L${SRCDIR}/build/macos-x86_64
// #cgo darwin,arm64 LDFLAGS:-L${SRCDIR}/build/macos-aarch64
// #cgo windows,amd64 LDFLAGS:-L${SRCDIR}/build/windows-x86_64
// #include <wasm.h>
import "C"
Expand Down
1 change: 1 addition & 0 deletions includebuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
_ "github.com/bytecodealliance/wasmtime-go/build/include"
_ "github.com/bytecodealliance/wasmtime-go/build/include/wasmtime"
_ "github.com/bytecodealliance/wasmtime-go/build/linux-x86_64"
_ "github.com/bytecodealliance/wasmtime-go/build/macos-aarch64"
_ "github.com/bytecodealliance/wasmtime-go/build/macos-x86_64"
_ "github.com/bytecodealliance/wasmtime-go/build/windows-x86_64"
)