forked from envoyproxy/envoy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
envoy_select.bzl
198 lines (173 loc) · 7.37 KB
/
envoy_select.bzl
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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
# DO NOT LOAD THIS FILE. Load envoy_build_system.bzl instead.
# Envoy select targets. This is in a separate file to avoid a circular
# dependency with envoy_build_system.bzl.
# Used to select a dependency that has different implementations on POSIX vs Windows.
# The platform-specific implementations should be specified with envoy_cc_posix_library
# and envoy_cc_win32_library respectively
def envoy_cc_platform_dep(name):
return select({
"@envoy//bazel:windows_x86_64": [name + "_win32"],
"//conditions:default": [name + "_posix"],
})
def envoy_select_boringssl(if_fips, default = None, if_disabled = None):
return select({
"@envoy//bazel:boringssl_fips": if_fips,
"@envoy//bazel:boringssl_disabled": if_disabled or [],
"//conditions:default": default or [],
})
# Selects the given values if Google gRPC is enabled in the current build.
def envoy_select_google_grpc(xs, repository = ""):
return select({
repository + "//bazel:disable_google_grpc": [],
"//conditions:default": xs,
})
# Selects the given values if logging is enabled in the current build.
def envoy_select_disable_logging(xs, repository = ""):
return select({
repository + "//bazel:disable_logging": xs,
"//conditions:default": [],
})
# Selects the given values if admin HTML is enabled in the current build.
def envoy_select_admin_html(xs, repository = ""):
return select({
repository + "//bazel:disable_admin_html": [],
"//conditions:default": xs,
})
# Selects the given values if admin functionality is enabled in the current build.
def envoy_select_admin_functionality(xs, repository = ""):
return select({
repository + "//bazel:disable_admin_functionality": [],
"//conditions:default": xs,
})
def envoy_select_admin_no_html(xs, repository = ""):
return select({
repository + "//bazel:disable_admin_html": xs,
"//conditions:default": [],
})
# Selects the given values if static extension registration is enabled in the current build.
def envoy_select_static_extension_registration(xs, repository = ""):
return select({
repository + "//bazel:disable_static_extension_registration": [],
"//conditions:default": xs,
})
# Selects the given values if the Envoy Mobile listener is enabled in the current build.
def envoy_select_envoy_mobile_listener(xs, repository = ""):
return select({
repository + "//bazel:disable_envoy_mobile_listener": [],
"//conditions:default": xs,
})
# Selects the given values if Envoy Mobile xDS is enabled in the current build.
def envoy_select_envoy_mobile_xds(xs, repository = ""):
return select({
repository + "//bazel:disable_envoy_mobile_xds": [],
"//conditions:default": xs,
})
# Selects the given values if http3 is enabled in the current build.
def envoy_select_enable_http3(xs, repository = ""):
return select({
repository + "//bazel:disable_http3": [],
"//conditions:default": xs,
})
# Selects the given values if yaml is enabled in the current build.
def envoy_select_enable_yaml(xs, repository = ""):
return select({
repository + "//bazel:disable_yaml": [],
"//conditions:default": xs,
})
# Selects the given values if exceptions are disabled in the current build.
def envoy_select_disable_exceptions(xs, repository = ""):
return select({
repository + "//bazel:disable_exceptions": xs,
"//conditions:default": [],
})
# Selects the given values if HTTP datagram support is enabled in the current build.
def envoy_select_enable_http_datagrams(xs, repository = ""):
return select({
repository + "//bazel:disable_http_datagrams": [],
"//conditions:default": xs,
})
# Selects the given values if hot restart is enabled in the current build.
def envoy_select_hot_restart(xs, repository = ""):
return select({
repository + "//bazel:disable_hot_restart": [],
"//conditions:default": xs,
})
# Selects the given values if full protos are enabled in the current build.
def envoy_select_enable_full_protos(xs, repository = ""):
return select({
repository + "//bazel:disable_full_protos": [],
"//conditions:default": xs,
})
# Selects the given values if lite protos are enabled in the current build.
def envoy_select_enable_lite_protos(xs, repository = ""):
return select({
repository + "//bazel:disable_full_protos": xs,
"//conditions:default": [],
})
# Selects the given values if signal trace is enabled in the current build.
def envoy_select_signal_trace(xs, repository = ""):
return select({
repository + "//bazel:disable_signal_trace": [],
"//conditions:default": xs,
})
# Selects the given values depending on the Wasm runtimes enabled in the current build,
# and the ability to build tests using Proxy-Wasm C++ SDK on the current platform.
def envoy_select_wasm_cpp_tests(xs):
return select({
"@envoy//bazel:not_x86_or_wasm_disabled": [],
"//conditions:default": xs,
})
# Selects the given values depending on the Wasm runtimes enabled in the current build,
# and the ability to build tests using Proxy-Wasm Rust SDK on the current platform.
def envoy_select_wasm_rust_tests(xs):
return select({
"@envoy//bazel:wasm_disabled": [],
# TODO(phlax): re-enable once issues with llvm profiler are resolved
# (see https://github.com/envoyproxy/envoy/issues/24164)
"@envoy//bazel:coverage_build": [],
"//conditions:default": xs,
})
# Selects the given values depending on the Wasm runtimes enabled in the current build.
def envoy_select_wasm_v8(xs):
return select({
"@envoy//bazel:wasm_v8": xs,
"@envoy//bazel:wasm_wamr": [],
"@envoy//bazel:wasm_wasmtime": [],
"@envoy//bazel:wasm_wavm": [],
"@envoy//bazel:wasm_disabled": [],
# TODO(phlax): re-enable once issues with llvm profiler are resolved
# (see https://github.com/envoyproxy/envoy/issues/24164)
"@envoy//bazel:coverage_build": [],
"//conditions:default": xs, # implicit default (v8)
})
# Selects True or False depending on the Wasm runtimes enabled in the current build.
def envoy_select_wasm_v8_bool():
return select({
"@envoy//bazel:wasm_v8": True,
"@envoy//bazel:wasm_wamr": False,
"@envoy//bazel:wasm_wasmtime": False,
"@envoy//bazel:wasm_wavm": False,
"@envoy//bazel:wasm_disabled": False,
# TODO(phlax): re-enable once issues with llvm profiler are resolved
# (see https://github.com/envoyproxy/envoy/issues/24164)
"@envoy//bazel:coverage_build": False,
"//conditions:default": True, # implicit default (v8)
})
# Selects the given values depending on the Wasm runtimes enabled in the current build.
def envoy_select_wasm_wamr(xs):
return select({
"@envoy//bazel:wasm_wamr": xs,
"//conditions:default": [],
})
# Selects the given values depending on the Wasm runtimes enabled in the current build.
def envoy_select_wasm_wavm(xs):
return select({
"@envoy//bazel:wasm_wavm": xs,
"//conditions:default": [],
})
# Selects the given values depending on the Wasm runtimes enabled in the current build.
def envoy_select_wasm_wasmtime(xs):
return select({
"@envoy//bazel:wasm_wasmtime": xs,
"//conditions:default": [],
})