/
BUILD.tpl
91 lines (80 loc) · 2 KB
/
BUILD.tpl
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
package(default_visibility = ["//visibility:public"])
load("@build_bazel_apple_support//configs:platforms.bzl", "APPLE_PLATFORMS_CONSTRAINTS")
load(":cc_toolchain_config.bzl", "cc_toolchain_config")
_APPLE_ARCHS = APPLE_PLATFORMS_CONSTRAINTS.keys()
CC_TOOLCHAINS = [(
cpu + "|clang",
":cc-compiler-" + cpu,
) for cpu in _APPLE_ARCHS] + [(
cpu,
":cc-compiler-" + cpu,
) for cpu in _APPLE_ARCHS] + [
("k8|clang", ":cc-compiler-darwin_x86_64"),
("darwin|clang", ":cc-compiler-darwin_x86_64"),
("k8", ":cc-compiler-darwin_x86_64"),
("darwin", ":cc-compiler-darwin_x86_64"),
]
cc_library(
name = "link_extra_lib",
)
cc_library(
name = "malloc",
)
filegroup(
name = "empty",
srcs = [],
)
filegroup(
name = "cc_wrapper",
srcs = ["cc_wrapper.sh"],
)
cc_toolchain_suite(
name = "toolchain",
toolchains = dict(CC_TOOLCHAINS),
)
[
filegroup(
name = "osx_tools_" + arch,
srcs = [
":cc_wrapper",
":libtool",
":libtool_check_unique",
":make_hashed_objlist.py",
":wrapped_clang",
":wrapped_clang_pp",
":xcrunwrapper.sh",
],
)
for arch in _APPLE_ARCHS
]
[
cc_toolchain(
name = "cc-compiler-" + arch,
all_files = ":osx_tools_" + arch,
ar_files = ":osx_tools_" + arch,
as_files = ":osx_tools_" + arch,
compiler_files = ":osx_tools_" + arch,
dwp_files = ":empty",
linker_files = ":osx_tools_" + arch,
objcopy_files = ":empty",
strip_files = ":osx_tools_" + arch,
supports_param_files = 1,
toolchain_config = arch,
toolchain_identifier = arch,
)
for arch in _APPLE_ARCHS
]
[
cc_toolchain_config(
name = arch,
cpu = arch,
features = [
%{features}
],
cxx_builtin_include_directories = [
%{cxx_builtin_include_directories}
],
tool_paths_overrides = {%{tool_paths_overrides}},
)
for arch in _APPLE_ARCHS
]