-
Notifications
You must be signed in to change notification settings - Fork 96
Expand file tree
/
Copy pathBUILD.bazel
More file actions
54 lines (51 loc) · 1.67 KB
/
BUILD.bazel
File metadata and controls
54 lines (51 loc) · 1.67 KB
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
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"],
"@io_bazel_rules_go//go/platform:linux_arm64": ["build/linux-aarch64/libwasmtime.a"],
}),
hdrs = glob(["build/include/**/*.h"]),
includes = ["build/include"],
visibility = ["//visibility:public"],
)
go_library(
name = "go_default_library",
srcs = glob(
[
"*.go",
"*.c",
"*.h",
],
exclude = ["*_test.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/v44",
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",
]
)