diff --git a/build/macos-aarch64/empty.go b/build/macos-aarch64/empty.go new file mode 100644 index 0000000..018ddfa --- /dev/null +++ b/build/macos-aarch64/empty.go @@ -0,0 +1 @@ +package macos_aarch64 diff --git a/ci/local.sh b/ci/local.sh index 4c3f9f1..d3aa214 100755 --- a/ci/local.sh +++ b/ci/local.sh @@ -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) @@ -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 diff --git a/ffi.go b/ffi.go index 4468a6d..7d47d7b 100644 --- a/ffi.go +++ b/ffi.go @@ -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 import "C" diff --git a/includebuild.go b/includebuild.go index f8eceb5..29ab90d 100644 --- a/includebuild.go +++ b/includebuild.go @@ -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" )