skia2/toolchain/BUILD.bazel
Kevin Lubick 9b7db63e6f [bazel] Sketch out changes for Mac toolchain
Change-Id: Idae84d8d9538012e5cfb75a1a477dbc72a4da5bc
Bug: skia:13125
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/526264
Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
2022-04-08 13:35:44 +00:00

51 lines
1.6 KiB
Python

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",
)