-
Notifications
You must be signed in to change notification settings - Fork 2
/
BUILD.bazel
40 lines (34 loc) · 928 Bytes
/
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
load("//lib:lib.bzl", "package_lib")
load("//toolchains:utils.bzl", "no_error")
load("//toolchains/make:configure.bzl", "configure_make_lib")
load("package.bzl", "BINARIES", "NAME", "STATIC_LIBS")
package(default_visibility = ["//:__subpackages__"])
package_lib(
runtime_for = [NAME],
)
C_FLAGS = no_error([
# keep sorted
"macro-redefined",
])
ENV = {"CFLAGS": C_FLAGS}
ENV_WASM = dict(ENV.items() + {
# Emscripten does not implement popen(), so ignore it:
"LDFLAGS": "-s ERROR_ON_UNDEFINED_SYMBOLS=0",
}.items())
configure_make_lib(
name = NAME,
configure_options = [
# keep sorted
"--enable-shared=no",
"--enable-static=yes",
],
env = {
"//config:wasm": ENV_WASM,
"//conditions:default": ENV,
},
out_binaries = select({
"//config:wasm": [],
"//conditions:default": BINARIES,
}),
out_static_libs = STATIC_LIBS,
)