-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtool_paths.bzl
More file actions
31 lines (29 loc) · 1.03 KB
/
tool_paths.bzl
File metadata and controls
31 lines (29 loc) · 1.03 KB
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
load("@bazel_tools//tools/cpp:toolchain_utils.bzl", "find_cpp_toolchain")
def _find_llvm_cov_aspect_impl(_target, ctx):
cc_toolchain = find_cpp_toolchain(ctx)
feature_configuration = cc_common.configure_features(
ctx = ctx,
cc_toolchain = cc_toolchain,
requested_features = ctx.features,
unsupported_features = ctx.disabled_features,
)
tool = cc_common.get_tool_for_action(
feature_configuration=feature_configuration,
action_name="llvm-cov",
)
llvm_cov_file = ctx.actions.declare_file("cc_toolchain_lcov_tool")
ctx.actions.write(llvm_cov_file, tool)
return [
OutputGroupInfo(tool_paths = depset([llvm_cov_file])),
]
find_llvm_cov = aspect(
implementation = _find_llvm_cov_aspect_impl,
required_providers = [CcInfo],
attrs = {
"_cc_toolchain": attr.label(
default = Label("@bazel_tools//tools/cpp:current_cc_toolchain"),
),
},
fragments = ["cpp"],
toolchains = ["@bazel_tools//tools/cpp:toolchain_type"],
)