| # 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. |
| |
| # This file lives at //build/unification/zircon_library_forward.gn; ONLY EDIT IT |
| # BY THAT NAME! |
| |
| # 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/unification/zircon_library_mappings.gni") |
| |
| dir = get_label_info(".", "name") |
| forward_target = false |
| |
| foreach(mapping, zircon_library_mappings) { |
| if (mapping.name == dir) { |
| assert(forward_target == false, "$dir appears twice in library mappings") |
| forward_target = mapping |
| } |
| } |
| |
| assert(forward_target != false, "Could not find $dir in library mappings") |
| |
| label = forward_target.label |
| assert(current_toolchain == get_label_info(label, "toolchain"), |
| "Cross-toolchain forwarding for ${label} is not currently supported") |
| |
| group(dir) { |
| public_deps = [ label ] |
| } |
| |
| if (forward_target.sdk) { |
| import("//build/sdk/sdk_atom_alias.gni") |
| |
| label_name = get_label_info(label, "name") |
| label_dir = get_label_info(label, "dir") |
| |
| sdk_atom_alias("${dir}_sdk") { |
| atom = "$label_dir:${label_name}_sdk" |
| } |
| } |