skia2/toolchain/download_toolchains.bzl
Jorge Betancourt b894c69abb set up tools for building Skia on Mac semi hermetically
Reviewer notes:
PS1 and PS2 handle everything up to the linking stage of the build
PS6 and PS7 are trivial renamings and rebases, diff between Base->PS5 for a cleaner review

No-Try: true
Change-Id: Ib21ce2e8839ecd4b4dd57280e82f56a98194e476
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/532765
Reviewed-by: Kevin Lubick <kjlubick@google.com>
Commit-Queue: Jorge Betancourt <jmbetancourt@google.com>
2022-05-04 16:56:46 +00:00

38 lines
1.2 KiB
Python

"""
This file exports the various toolchains for the hosts that we support building Skia on.
Supported:
- Linux amd64
- Mac M1
Planned:
- Windows amd64
"""
load(":download_linux_amd64_toolchain.bzl", "download_linux_amd64_toolchain")
load(":download_mac_m1_toolchain.bzl", "download_mac_m1_toolchain")
# This key in this dictionary (and thus the name passed into the rule) controls what the subfolder
# will be called in the external directory. It must match what we use in the appropriate
# toolchain_config.bzl file or it will not be able to locate the sysroot to build with.
name_toolchain = {
"clang_linux_amd64": download_linux_amd64_toolchain,
"clang_mac_m1": download_mac_m1_toolchain,
}
def download_toolchains_for_skia(*args):
"""
Point Bazel to the correct rules for downloading the different toolchains.
Args:
*args: multiple toolchains, see top of file for
list of supported toolchains.
"""
for toolchain_name in args:
if toolchain_name not in name_toolchain:
fail("unrecognized toolchain name " + toolchain_name)
download_toolchain = name_toolchain[toolchain_name]
download_toolchain(name = toolchain_name)