• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite")
2load(":clang_toolchain_config.bzl", "provide_clang_toolchain_config")
3
4package(default_visibility = ["//visibility:public"])
5
6# https://docs.bazel.build/versions/main/be/c-cpp.html#cc_toolchain_suite
7cc_toolchain_suite(
8    name = "clang_suite",
9    toolchains = {
10        # The key is target_cpu|compiler
11        "k8|clang": ":clang_toolchain",
12        "x86_64|clang": ":clang_toolchain",
13    },
14)
15
16filegroup(name = "not_implemented")
17
18filegroup(
19    name = "all-toolchain-files",
20    srcs = [
21        "ar_trampoline.sh",
22        "clang_trampoline.sh",
23        "lld_trampoline.sh",
24        "@clang_linux_amd64_musl//:all_files",
25    ],
26)
27
28provide_clang_toolchain_config(
29    name = "clang_toolchain_config",
30)
31
32cc_toolchain(
33    name = "clang_toolchain",
34    all_files = ":all-toolchain-files",
35    ar_files = ":all-toolchain-files",
36    compiler_files = ":all-toolchain-files",
37    dwp_files = ":not_implemented",
38    linker_files = ":all-toolchain-files",
39    objcopy_files = ":not_implemented",
40    strip_files = ":not_implemented",
41    supports_param_files = 0,
42    toolchain_config = ":clang_toolchain_config",
43    toolchain_identifier = "clang-toolchain",
44)
45