1""" 2This file exports the various toolchains for the hosts that we support building Skia on. 3 4Supported: 5 - Linux amd64 6 - Mac (one toolchain for both M1 and Intel CPUs) 7 8Planned: 9 - Windows amd64 10 11""" 12 13load(":download_linux_amd64_toolchain.bzl", "download_linux_amd64_toolchain") 14load(":download_mac_toolchain.bzl", "download_mac_toolchain") 15load(":download_ndk_linux_amd64_toolchain.bzl", "download_ndk_linux_amd64_toolchain") 16 17# This key in this dictionary (and thus the name passed into the rule) controls what the subfolder 18# will be called in the external directory. It must match what we use in the appropriate 19# toolchain_config.bzl file or it will not be able to locate the sysroot to build with. 20name_toolchain = { 21 "clang_linux_amd64": download_linux_amd64_toolchain, 22 "clang_mac": download_mac_toolchain, 23 "ndk_linux_amd64": download_ndk_linux_amd64_toolchain, 24} 25 26def download_toolchains_for_skia(*args): 27 """ 28 Point Bazel to the correct rules for downloading the different toolchains. 29 30 Args: 31 *args: multiple toolchains, see top of file for 32 list of supported toolchains. 33 """ 34 35 for toolchain_name in args: 36 if toolchain_name not in name_toolchain: 37 fail("unrecognized toolchain name " + toolchain_name) 38 download_toolchain = name_toolchain[toolchain_name] 39 download_toolchain(name = toolchain_name) 40