-
Notifications
You must be signed in to change notification settings - Fork 19
/
BUILD.bazel
69 lines (61 loc) · 1.94 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
load("@bazel_tools//tools/python:toolchain.bzl", "py_runtime_pair")
package(default_visibility = ["//visibility:public"])
[filegroup(
name = platform,
srcs = glob([
"common/**",
"%s/bin/*" % platform,
"%s/lib64/*" % platform,
"path/%s/*" % platform,
]),
) for platform in ("linux-x86", "darwin")]
py_runtime(
name = "python2",
files = ["linux-x86/bin/py2-cmd"],
interpreter = "linux-x86/bin/py2-cmd",
python_version = "PY2",
)
py_runtime(
name = "python3",
files = ["linux-x86/bin/py3-cmd"],
interpreter = "linux-x86/bin/py3-cmd",
python_version = "PY3",
)
py_runtime_pair(
name = "py_runtime_pair",
py2_runtime = ":python2",
py3_runtime = ":python3",
)
toolchain(
name = "py_toolchain",
toolchain = ":py_runtime_pair",
toolchain_type = "@bazel_tools//tools/python:toolchain_type",
)
sh_binary(
name = "flex",
srcs = select({
"//build/bazel/platforms/os:darwin": ["darwin-x86/bin/flex"],
"//build/bazel/platforms/os:linux": ["linux-x86/bin/flex"],
"//build/bazel/platforms/os_arch:linux_musl_x86": ["linux_musl-x86/bin/flex"],
}),
target_compatible_with = select({
"//build/bazel/platforms/os:darwin": [],
"//build/bazel/platforms/os:linux": [],
"//build/bazel/platforms/os_arch:linux_musl_x86": [],
"//conditions:default": ["@platforms//:incompatible"],
}),
)
sh_binary(
name = "m4",
srcs = select({
"//build/bazel/platforms/os:darwin": ["darwin-x86/bin/m4"],
"//build/bazel/platforms/os:linux": ["linux-x86/bin/m4"],
"//build/bazel/platforms/os_arch:linux_musl_x86": ["linux_musl-x86/bin/m4"],
}),
target_compatible_with = select({
"//build/bazel/platforms/os:darwin": [],
"//build/bazel/platforms/os:linux": [],
"//build/bazel/platforms/os_arch:linux_musl_x86": [],
"//conditions:default": ["@platforms//:incompatible"],
}),
)