skia2/toolchain/BUILD.bazel
Kevin Lubick b98328a27b [bazel] Add license to all our BUILD.bazel files
find -name "BUILD.bazel" -exec sed -i -e '1i licenses(["notice"])\n' {} +

Change-Id: Ie48f163b7d8d6ede9ba5f952e87232dd5c9fa8e6
Bug: skia:12541
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/529808
Reviewed-by: Ben Wagner <bungeman@google.com>
2022-04-13 19:50:29 +00:00

53 lines
1.6 KiB
Python

licenses(["notice"])
load("@rules_cc//cc:defs.bzl", "cc_toolchain", "cc_toolchain_suite")
load(":linux_amd64_toolchain_config.bzl", "provide_linux_amd64_toolchain_config")
package(default_visibility = ["//visibility:public"])
# https://bazel.build/reference/be/c-cpp#cc_toolchain_suite
cc_toolchain_suite(
name = "clang_suite",
toolchains = {
# The key is target_cpu|compiler
# compiler appears to be a string we can choose arbitrarily
# https://bazel.build/reference/command-line-reference?hl=en#flag--compiler
"k8|host_is_linux_amd64": ":linux_amd64_host",
"x86_64|host_is_linux_amd64": ":linux_amd64_host",
"k8": ":linux_amd64_host",
# TODO(jmbetancourt)
# "arm64|host_is_mac_M1": ":mac_M1_host",
},
)
filegroup(name = "not_implemented")
filegroup(
name = "all_linux_amd64_files",
srcs = [
"IWYU_mapping.imp",
"ar_trampoline.sh",
"clang_trampoline.sh",
"lld_trampoline.sh",
"@clang_linux_amd64//:all_files",
],
)
provide_linux_amd64_toolchain_config(
name = "linux_amd64_toolchain_config",
)
# https://bazel.build/reference/be/c-cpp#cc_toolchain
cc_toolchain(
name = "linux_amd64_host",
all_files = ":all_linux_amd64_files",
ar_files = ":all_linux_amd64_files",
compiler_files = ":all_linux_amd64_files",
dwp_files = ":not_implemented",
linker_files = ":all_linux_amd64_files",
objcopy_files = ":not_implemented",
strip_files = ":not_implemented",
supports_param_files = False,
toolchain_config = ":linux_amd64_toolchain_config",
)