-
Notifications
You must be signed in to change notification settings - Fork 2
/
BUILD
162 lines (150 loc) · 3.5 KB
/
BUILD
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
load("@rules_cc//cc:defs.bzl", "cc_library")
load(
"@proxy_wasm_cpp_host//bazel:select.bzl",
"proxy_wasm_select_runtime_v8",
"proxy_wasm_select_runtime_wamr",
"proxy_wasm_select_runtime_wasmtime",
"proxy_wasm_select_runtime_wavm",
)
licenses(["notice"]) # Apache 2
package(default_visibility = ["//visibility:public"])
exports_files(["LICENSE"])
cc_library(
name = "wasm_vm_headers",
hdrs = [
"include/proxy-wasm/wasm_vm.h",
"include/proxy-wasm/word.h",
],
deps = [
"@proxy_wasm_cpp_sdk//:common_lib",
],
)
cc_library(
name = "headers",
hdrs = [
"include/proxy-wasm/context.h",
"include/proxy-wasm/context_interface.h",
"include/proxy-wasm/exports.h",
"include/proxy-wasm/vm_id_handle.h",
"include/proxy-wasm/wasm.h",
],
deps = [
":wasm_vm_headers",
],
)
cc_library(
name = "base_lib",
srcs = [
"src/bytecode_util.cc",
"src/context.cc",
"src/exports.cc",
"src/shared_data.cc",
"src/shared_data.h",
"src/shared_queue.cc",
"src/shared_queue.h",
"src/signature_util.cc",
"src/vm_id_handle.cc",
"src/wasm.cc",
],
hdrs = [
"include/proxy-wasm/bytecode_util.h",
"include/proxy-wasm/signature_util.h",
],
deps = [
":headers",
"@openssl//:openssl-lib",
],
)
cc_library(
name = "null_lib",
srcs = [
"src/null/null.cc",
"src/null/null_plugin.cc",
"src/null/null_vm.cc",
],
hdrs = [
"include/proxy-wasm/null.h",
"include/proxy-wasm/null_plugin.h",
"include/proxy-wasm/null_vm.h",
"include/proxy-wasm/null_vm_plugin.h",
"include/proxy-wasm/wasm_api_impl.h",
],
defines = ["PROXY_WASM_HAS_RUNTIME_NULL"],
deps = [
":headers",
"@com_google_protobuf//:protobuf_lite",
"@proxy_wasm_cpp_sdk//:api_lib",
],
)
cc_library(
name = "v8_lib",
srcs = [
"src/v8/v8.cc",
],
hdrs = ["include/proxy-wasm/v8.h"],
defines = ["PROXY_WASM_HAS_RUNTIME_V8"],
deps = [
":wasm_vm_headers",
"//external:wee8",
],
)
cc_library(
name = "wamr_lib",
srcs = [
"src/common/types.h",
"src/wamr/types.h",
"src/wamr/wamr.cc",
],
hdrs = ["include/proxy-wasm/wamr.h"],
defines = ["PROXY_WASM_HAS_RUNTIME_WAMR"],
deps = [
":wasm_vm_headers",
"//external:wamr",
],
)
cc_library(
name = "wasmtime_lib",
srcs = [
"src/common/types.h",
"src/wasmtime/types.h",
"src/wasmtime/wasmtime.cc",
],
hdrs = ["include/proxy-wasm/wasmtime.h"],
defines = ["PROXY_WASM_HAS_RUNTIME_WASMTIME"],
deps = [
":wasm_vm_headers",
"//external:wasmtime",
],
)
cc_library(
name = "wavm_lib",
srcs = [
"src/wavm/wavm.cc",
],
hdrs = ["include/proxy-wasm/wavm.h"],
copts = [
'-DWAVM_API=""',
"-Wno-non-virtual-dtor",
"-Wno-old-style-cast",
],
defines = ["PROXY_WASM_HAS_RUNTIME_WAVM"],
deps = [
":wasm_vm_headers",
"//external:wavm",
],
)
cc_library(
name = "lib",
deps = [
":base_lib",
":null_lib",
] + proxy_wasm_select_runtime_v8(
[":v8_lib"],
) + proxy_wasm_select_runtime_wamr(
[":wamr_lib"],
) + proxy_wasm_select_runtime_wasmtime(
[":wasmtime_lib"],
) + proxy_wasm_select_runtime_wavm(
[":wavm_lib"],
),
)