File tree Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Expand file tree Collapse file tree 1 file changed +32
-0
lines changed Original file line number Diff line number Diff line change 1+ load ("@bazel_tools//tools/cpp:toolchain_utils.bzl" , "find_cpp_toolchain" )
2+
3+ def _find_llvm_cov_aspect_impl (_target , ctx ):
4+ cc_toolchain = find_cpp_toolchain (ctx )
5+ feature_configuration = cc_common .configure_features (
6+ ctx = ctx ,
7+ cc_toolchain = cc_toolchain ,
8+ requested_features = ctx .features ,
9+ unsupported_features = ctx .disabled_features ,
10+ )
11+ tool = cc_common .get_tool_for_action (
12+ feature_configuration = feature_configuration ,
13+ action_name = "llvm-cov" ,
14+ )
15+ llvm_cov_file = ctx .actions .declare_file ("cc_toolchain_lcov_tool" )
16+ ctx .actions .write (llvm_cov_file , tool )
17+ return [
18+ OutputGroupInfo (tool_paths = depset ([llvm_cov_file ])),
19+ ]
20+
21+ find_llvm_cov = aspect (
22+ implementation = _find_llvm_cov_aspect_impl ,
23+ attr_aspects = [],
24+ required_providers = [CcInfo ],
25+ attrs = {
26+ "_cc_toolchain" : attr .label (
27+ default = Label ("@bazel_tools//tools/cpp:current_cc_toolchain" ),
28+ ),
29+ },
30+ fragments = ["cpp" ],
31+ toolchains = ["@bazel_tools//tools/cpp:toolchain_type" ],
32+ )
You can’t perform that action at this time.
0 commit comments