| # Copyright 2020 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. |
| |
| # Define a number of global variables that are normally defined by the Zircon |
| # build system. This should only be used when processing Zircon-specific target |
| # rules under //zircon/ which invoke zx_library() or zx_host_tool() |
| |
| # `is_gcc` is true for GCC-based toolchains. |
| is_gcc = |
| toolchain_variant.tags + [ "gcc" ] - [ "gcc" ] != toolchain_variant.tags |
| |
| # `is_kernel` is true for kernel-specific toolchains. |
| is_kernel = toolchain_variant.tags + [ "kernel" ] - [ "kernel" ] != |
| toolchain_variant.tags |
| |
| # `toolchain` is a scope used by the Zircon build to describe the current toolchain. |
| # Its layout is very different from `toolchain_variant` so try to mimic it here. |
| toolchain = { |
| if (zircon_toolchain != false) { |
| environment = zircon_toolchain.environment |
| } else if (is_fuchsia) { |
| environment = "user" |
| } else if (is_host) { |
| environment = "host" |
| } else { |
| environment = "unknown" |
| } |
| } |
| |
| # This is the name for $current_cpu that's used in Zircon file names. |
| if (current_cpu == "x64") { |
| zircon_cpu = "x86" |
| } else if (current_cpu != "") { |
| zircon_cpu = current_cpu |
| } |