github.com/prysmaticlabs/prysm@v1.4.4/tools/cross-toolchain/configs/clang/bazel_2.1.1/prysm_toolchains/BUILD.bazel (about)

     1  package(default_visibility = ["//visibility:public"])
     2  
     3  load(":cc_toolchain_config_osx.bzl", "osx_cc_toolchain_config")
     4  load(":cc_toolchain_config_linux_arm64.bzl", "arm64_cc_toolchain_config")
     5  load(":cc_toolchain_config_windows.bzl", "windows_cc_toolchain_config")
     6  
     7  cc_toolchain_suite(
     8      name = "multiarch_toolchain",
     9      toolchains = {
    10          "k8|osxcross": ":cc-clang-osx",
    11          "k8|clang": "cc-clang-amd64",
    12          "aarch64|clang": ":cc-clang-arm64",
    13          "k8": "cc-clang-amd64",
    14          "aarch64": ":cc-clang-arm64",
    15          "k8|mingw-w64": ":cc-mingw-amd64",
    16      },
    17  )
    18  
    19  cc_toolchain_suite(
    20      name = "hostonly_toolchain",
    21      toolchains = {
    22          "k8": "cc-clang-amd64",
    23      },
    24  )
    25  
    26  filegroup(
    27      name = "empty",
    28      srcs = [],
    29  )
    30  
    31  config_setting(
    32      name = "osx_amd64",
    33      constraint_values = [
    34          "@platforms//os:osx",
    35          "@platforms//cpu:x86_64",
    36      ],
    37  )
    38  
    39  config_setting(
    40      name = "linux_arm64",
    41      constraint_values = [
    42          "@platforms//os:linux",
    43          "@platforms//cpu:aarch64",
    44      ],
    45  )
    46  
    47  config_setting(
    48      name = "linux_amd64",
    49      constraint_values = [
    50          "@platforms//os:linux",
    51          "@platforms//cpu:x86_64",
    52      ],
    53  )
    54  
    55  config_setting(
    56      name = "windows_amd64",
    57      constraint_values = [
    58          "@platforms//os:windows",
    59          "@platforms//cpu:x86_64",
    60      ],
    61  )
    62  
    63  arm64_cc_toolchain_config(
    64      name = "local-arm64",
    65      target = "aarch64-linux-gnu",
    66  )
    67  
    68  arm64_cc_toolchain_config(
    69      name = "local-amd64",
    70      target = "x86_64-unknown-linux-gnu",
    71  )
    72  
    73  osx_cc_toolchain_config(
    74      name = "local-osxcross",
    75      target = "darwin_x86_64",
    76  )
    77  
    78  windows_cc_toolchain_config(
    79      name = "local-windows",
    80      target = "x86_64-w64",
    81  )
    82  
    83  cc_toolchain(
    84      name = "cc-mingw-amd64",
    85      all_files = ":empty",
    86      ar_files = ":empty",
    87      as_files = ":mingw_compiler_files",
    88      compiler_files = ":mingw_compiler_files",
    89      dwp_files = ":empty",
    90      linker_files = ":empty",
    91      objcopy_files = ":empty",
    92      strip_files = ":empty",
    93      supports_param_files = 0,
    94      toolchain_config = ":local-windows",
    95  )
    96  
    97  cc_toolchain(
    98      name = "cc-clang-arm64",
    99      all_files = ":empty",
   100      compiler_files = ":empty",
   101      dwp_files = ":empty",
   102      linker_files = ":empty",
   103      objcopy_files = ":empty",
   104      strip_files = ":empty",
   105      supports_param_files = 1,
   106      toolchain_config = ":local-arm64",
   107  )
   108  
   109  cc_toolchain(
   110      name = "cc-clang-osx",
   111      all_files = ":empty",
   112      compiler_files = ":empty",
   113      dwp_files = ":empty",
   114      linker_files = ":empty",
   115      objcopy_files = ":empty",
   116      strip_files = ":empty",
   117      supports_param_files = 1,
   118      toolchain_config = ":local-osxcross",
   119  )
   120  
   121  cc_toolchain(
   122      name = "cc-clang-amd64",
   123      all_files = ":empty",
   124      compiler_files = ":empty",
   125      dwp_files = ":empty",
   126      linker_files = ":empty",
   127      objcopy_files = ":empty",
   128      strip_files = ":empty",
   129      supports_param_files = 1,
   130      toolchain_config = ":local-amd64",
   131  )
   132  
   133  toolchain(
   134      name = "cc-toolchain-multiarch",
   135      exec_compatible_with = [
   136          "@platforms//os:linux",
   137          "@platforms//cpu:x86_64",
   138      ],
   139      target_compatible_with = [],
   140      toolchain = select({
   141          ":linux_arm64": ":cc-clang-arm64",
   142          ":linux_amd64": ":cc-clang-amd64",
   143          ":osx_amd64": ":cc-clang-osx",
   144          ":windows_amd64": ":cc-mingw-amd64",
   145      }),
   146      toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
   147  )