blob: 2ee29f98635dd9269c06be236958bc4bee03a9bb [file] [log] [blame]
# Copyright 2019 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.
# This file lives at //build/zircon/template.gn; ONLY EDIT IT BY THAT NAME!
# This file is hard-linked to various //zircon/public/*/BUILD.gn files.
# See //zircon/public/README.md for details.
# Please do not remove the "ONLY EDIT IT BY THAT NAME!" bit as it is used as a
# marker to determine whether a build file was derived from the present file.
# There, here's another one to be really sure: ONLY EDIT IT BY THAT NAME!
import("//build/config/fuchsia/zircon_legacy_vars.gni")
dir = get_label_info(".", "name")
zircon_public = get_label_info("..", "name")
dir_target = false
if (is_fuchsia) {
target_list = zircon_legacy_targets
} else {
target_list = zircon_legacy_host_targets
}
foreach(target, target_list) {
if (target.target_name == dir && target._zircon_public == zircon_public) {
if (is_fuchsia) {
meta = "legacy_targets"
} else {
meta = "legacy_host_targets"
}
assert(!dir_target,
"$dir appears twice in Zircon $meta metadata:" +
" $dir_target vs $target")
dir_target = target
}
}
if (is_fuchsia) {
type = "legacy"
} else {
type = "legacy host"
}
assert(dir_target != false, "Could not find $dir in Zircon $type metadata")
import(dir_target.import)
target(dir_target.target_type, dir) {
forward_variables_from(dir_target,
"*",
[
"import",
"target_name",
"target_type",
])
}