-
Notifications
You must be signed in to change notification settings - Fork 80
/
BUILD.bazel
77 lines (74 loc) · 2.09 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
cc_library(
name = "wasmtime",
srcs = select({
"@io_bazel_rules_go//go/platform:darwin_amd64": ["build/macos-x86_64/libwasmtime.a"],
"@io_bazel_rules_go//go/platform:linux_amd64": ["build/linux-x86_64/libwasmtime.a"],
"@io_bazel_rules_go//go/platform:windows_amd64": ["build/windows-x86_64/libwasmtime.a"],
"@io_bazel_rules_go//go/platform:darwin_arm64": ["build/macos-aarch64/libwasmtime.a"],
}),
hdrs = glob(["build/include/**/*.h"]),
includes = ["build/include"],
visibility = ["//visibility:public"],
)
go_library(
name = "go_default_library",
srcs = [
"config.go",
"doc.go",
"engine.go",
"error.go",
"exporttype.go",
"extern.go",
"externtype.go",
"ffi.go",
"func.go",
"functype.go",
"global.go",
"globaltype.go",
"importtype.go",
"instance.go",
"linker.go",
"maybe_gc_no.go",
"memory.go",
"memorytype.go",
"module.go",
"shims.c",
"shims.h",
"slab.go",
"store.go",
"table.go",
"tabletype.go",
"trap.go",
"val.go",
"valtype.go",
"wasi.go",
"wat2wasm.go",
],
cdeps = [":wasmtime"], # add wasmtime dep
cgo = True,
clinkopts = select({
"@io_bazel_rules_go//go/platform:windows": [
"-luserenv -lole32 -lntdll -lws2_32 -lkernel32 -lbcrypt",
],
"//conditions:default": ["-lm -ldl"],
}),
copts = [
"-Ibuild/include",
] + select({
"@io_bazel_rules_go//go/platform:windows": [
"-DWASM_API_EXTERN= -DWASI_API_EXTERN=",
],
"//conditions:default": [],
}),
importpath = "github.com/bytecodealliance/wasmtime-go/v28",
visibility = ["//visibility:public"],
)
go_test(
name = "go_default_test",
srcs = glob(["**/*_test.go"]),
embed = [":go_default_library"],
deps = [
"@com_github_stretchr_testify//require:go_default_library",
]
)