@@ -33,63 +33,12 @@ filegroup(
33
33
34
34
filegroup(
35
35
name = "sysroot_components",
36
- srcs = [% { sysroot_label } ] ,
36
+ srcs = % { sysroot_labels } ,
37
37
)
38
38
39
- cc_toolchain_suite(
40
- name = "toolchain",
41
- toolchains = {
42
- " k8|clang" : " :cc-clang-linux" ,
43
- " darwin|clang" : " :cc-clang-darwin" ,
44
- " k8" : " :cc-clang-linux" ,
45
- " darwin" : " :cc-clang-darwin" ,
46
- } ,
47
- )
48
-
49
- load(":cc_toolchain_config.bzl", "cc_toolchain_config")
50
-
51
- cc_toolchain_config(
52
- name = "local_linux",
53
- cpu = "k8",
54
- )
55
-
56
- cc_toolchain_config(
57
- name = "local_darwin",
58
- cpu = "darwin",
59
- )
60
-
61
- toolchain(
62
- name = "cc-toolchain-darwin",
63
- exec_compatible_with = [
64
- "@platforms//cpu:x86_64",
65
- "@platforms//os:osx",
66
- ],
67
- target_compatible_with = [
68
- "@platforms//cpu:x86_64",
69
- "@platforms//os:osx",
70
- ],
71
- toolchain = ":cc-clang-darwin",
72
- toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
73
- )
74
-
75
- toolchain(
76
- name = "cc-toolchain-linux",
77
- exec_compatible_with = [
78
- "@platforms//cpu:x86_64",
79
- "@platforms//os:linux",
80
- ],
81
- target_compatible_with = [
82
- "@platforms//cpu:x86_64",
83
- "@platforms//os:linux",
84
- ],
85
- toolchain = ":cc-clang-linux",
86
- toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
87
- )
88
-
89
- load("@com_grail_bazel_toolchain//toolchain:rules.bzl", "conditional_cc_toolchain")
39
+ load(":cc_toolchain_config.bzl", "do_toolchain_configs")
90
40
91
- conditional_cc_toolchain("cc-clang-linux", False, %{ absolute_paths} )
92
- conditional_cc_toolchain("cc-clang-darwin", True, %{ absolute_paths} )
41
+ do_toolchain_configs()
93
42
94
43
## LLVM toolchain files
95
44
# Needed when not using absolute paths.
@@ -115,22 +64,24 @@ filegroup(
115
64
filegroup(
116
65
name = "include",
117
66
srcs = glob([
118
- "include/c++/**",
119
- "lib/clang/%{ llvm_version} /include/**",
120
- ]),
67
+ "libcxx-*/include/c++/**",
68
+ ] + ["%sinclude/c++/**" % maybe_target for maybe_target in %{ all_maybe_target} ]
69
+ + ["%slib/clang/%{ llvm_version} /include/**" % maybe_target for maybe_target in %{ all_maybe_target} ]
70
+ ),
121
71
)
122
72
123
73
filegroup(
124
74
name = "lib",
125
75
srcs = glob(
126
76
[
127
- "lib/lib*.a",
128
- "lib/clang/%{ llvm_version} /lib/**/*.a",
129
- ],
77
+ "libcxx-*/lib/lib*.a",
78
+ ] + ["%slib/lib*.a" % maybe_target for maybe_target in %{ all_maybe_target} ]
79
+ + ["%slib/clang/%{ llvm_version} /lib/**/*.a" % maybe_target for maybe_target in %{ all_maybe_target} ]
80
+ + ["%slib/clang/%{ llvm_version} /lib/**/*.a.syms" % maybe_target for maybe_target in %{ all_maybe_target} ],
130
81
exclude = [
131
- "lib/libLLVM*.a",
132
- "lib/libclang*.a",
133
- "lib/liblld*.a",
82
+ "**/ lib/libLLVM*.a",
83
+ "**/ lib/libclang*.a",
84
+ "**/ lib/liblld*.a",
134
85
],
135
86
),
136
87
)
@@ -141,7 +92,8 @@ filegroup(
141
92
":clang",
142
93
":include",
143
94
":sysroot_components",
144
- ],
95
+ "@com_grail_bazel_toolchain//toolchain:blacklists",
96
+ ] + %{ cuda_path_labels} ,
145
97
)
146
98
147
99
filegroup(
@@ -167,6 +119,11 @@ filegroup(
167
119
srcs = ["bin/llvm-objcopy"],
168
120
)
169
121
122
+ filegroup(
123
+ name = "strip",
124
+ srcs = ["bin/llvm-strip"],
125
+ )
126
+
170
127
filegroup(
171
128
name = "objdump",
172
129
srcs = ["bin/llvm-objdump"],
@@ -192,6 +149,21 @@ filegroup(
192
149
srcs = ["bin/llvm-readelf"],
193
150
)
194
151
152
+ filegroup(
153
+ name = "clang-format",
154
+ srcs = ["bin/clang-format"],
155
+ )
156
+
157
+ filegroup(
158
+ name = "git-clang-format",
159
+ srcs = ["bin/git-clang-format"],
160
+ )
161
+
162
+ sh_binary(
163
+ name = "llvm-cov",
164
+ srcs = ["bin/llvm-cov"],
165
+ )
166
+
195
167
filegroup(
196
168
name = "binutils_components",
197
169
srcs = glob(["bin/*"]),
@@ -205,6 +177,7 @@ filegroup(
205
177
":ar",
206
178
":lib",
207
179
":sysroot_components",
180
+ "@com_grail_bazel_toolchain//toolchain:blacklists",
208
181
],
209
182
)
210
183
0 commit comments