blob: 82e160e889bc3ba96e8a7f6c1c45a6b1d7746068 [file] [log] [blame]
# Copyright 2021 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.
# The `toolchain_environment` variable corresponds to the runtime environment that the
# binaries generated by the current toolchain will run in.
if (zircon_toolchain != false) {
toolchain_environment = zircon_toolchain.environment
} else if (is_fuchsia) {
toolchain_environment = "user"
} else {
toolchain_environment =
string_replace(get_label_info(toolchain_variant.base, "name"),
"_$current_cpu",
"")
}
# Some environment definitions use a dotted suffix (e.g. kernel.phys32 and
# kernel.phys), the `toolchain_base_environment` returns the suffix-less
# environment value (e.g. "kernel").
toolchain_base_environment = get_path_info(toolchain_environment, "name")