|  | # Copyright 2025 The Fuchsia Authors. All rights reserved. | 
|  | # Use of this source code is governed by a BSD-style license that can be | 
|  | # found in the LICENSE file. | 
|  |  | 
|  | assert(defined(clang_toolchain_info)) | 
|  |  | 
|  | # This file defines clang_target_toolchain_info to point to the scope | 
|  | # value from clang_toolchain_info.<clang_target_key> where | 
|  | # <clang_target_key> is the scope key corresponding to the current | 
|  | # Clang target tuple (or "fallback" if not supported by the input scope). | 
|  |  | 
|  | # Unlike clang_toolchain_info.gni, this file can be imported outside | 
|  | # of //build/config/BUILDCONFIG.gn. | 
|  | import("//build/config/clang/clang_toolchain_info.gni") | 
|  | import("//build/config/current_target_tuple.gni") | 
|  |  | 
|  | # A convenience scope exposing the clang_toolchain_info values | 
|  | # corresponding to the current Clang target tuple. | 
|  | _clang_target_key = string_replace(current_target_tuple, "-", "_") | 
|  | if (defined(clang_toolchain_info[_clang_target_key])) { | 
|  | clang_target_toolchain_info = clang_toolchain_info[_clang_target_key] | 
|  | } else { | 
|  | # This target tuple is not covered by clang_toolchain_info. This happens | 
|  | # for weird combinations like "aarch64-pc-windows-msvc" which are used | 
|  | # for the EFI bootloader. In this case, use the fallback version. | 
|  | clang_target_toolchain_info = clang_toolchain_info["fallback"] | 
|  | } |