Skip to content

Commit 21d072a

Browse files
committed
Add windows builds to CI
This commit adds a Windows build to CI now that upstream has a MinGW build as well. Closes bytecodealliance#3
1 parent 942ef8a commit 21d072a

File tree

3 files changed

+12
-3
lines changed

3 files changed

+12
-3
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@ jobs:
1212
build:
1313
runs-on: ${{ matrix.os }}
1414
strategy:
15+
fail-fast: false
1516
matrix:
16-
os: [ubuntu-latest, macos-latest]
17+
os: [ubuntu-latest, macos-latest, windows-latest]
1718
go: ['1.14']
1819
steps:
1920
- uses: actions/checkout@v2

ci/download-wasmtime.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import glob
1212

1313
urls = [
14+
['wasmtime-dev-x86_64-mingw-c-api.zip', 'windows-x86_64'],
1415
['wasmtime-dev-x86_64-linux-c-api.tar.xz', 'linux-x86_64'],
1516
['wasmtime-dev-x86_64-macos-c-api.tar.xz', 'macos-x86_64'],
1617
]
@@ -31,8 +32,12 @@
3132
with urllib.request.urlopen(url) as f:
3233
contents = f.read()
3334

34-
t = tarfile.open(fileobj=io.BytesIO(contents))
35-
t.extractall()
35+
if filename.endswith('.zip'):
36+
z = zipfile.ZipFile(file=io.BytesIO(contents))
37+
z.extractall()
38+
else:
39+
t = tarfile.open(fileobj=io.BytesIO(contents))
40+
t.extractall()
3641

3742
src = filename.replace('.zip', '').replace('.tar.xz', '')
3843
if i == 0:

ffi.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ package wasmtime
22

33
// #cgo CFLAGS:-I${SRCDIR}/build/include
44
// #cgo !windows LDFLAGS:-lwasmtime -lm -ldl
5+
// #cgo windows CFLAGS:-DWASM_API_EXTERN= -DWASI_API_EXTERN=
6+
// #cgo windows LDFLAGS:-lwasmtime -luserenv -lole32 -lntdll -lws2_32 -lkernel32
57
// #cgo linux,amd64 LDFLAGS:-L${SRCDIR}/build/linux-x86_64
68
// #cgo darwin,amd64 LDFLAGS:-L${SRCDIR}/build/macos-x86_64
9+
// #cgo windows,amd64 LDFLAGS:-L${SRCDIR}/build/windows-x86_64
710
// #include <wasm.h>
811
import "C"
912
import "runtime"

0 commit comments

Comments
 (0)