Skip to content
Snippets Groups Projects
Commit c9d487fe authored by Roland McGrath's avatar Roland McGrath Committed by CQ bot account: commit-bot@chromium.org
Browse files

[build] Allow //zircon/public/lib/foo vs //zircon/public/tool/foo name reuse

Subdirectories in different parts of the Zircon tree reusing the same
name is not a problem, and neither is //zircon/public/*/NAME reuse.
Fix the metadata-based target generation magic to distinguish the
category (i.e. subdirectory under //zircon/public/) so that names
can be reused across categories.

Bug: BLD-472 #done
Test: local build with //zircon/public/lib/blobfs export enabled
Change-Id: I592e52f524471a006bec2ff5942215ec277705dd
parent 4eb6a488
No related branches found
No related tags found
No related merge requests found
......@@ -9,10 +9,11 @@
import("//build/config/fuchsia/zircon.gni")
dir = get_label_info(".", "name")
zircon_public = get_label_info("..", "name")
dir_target = false
foreach(target, zircon_legacy_targets) {
if (target.target_name == dir) {
if (target.target_name == dir && target._zircon_public == zircon_public) {
assert(dir_target == false,
"$dir appears twice in Zircon legacy_targets metadata:" +
" $dir_target vs $target")
......
......@@ -413,6 +413,7 @@ template("library") {
legacy_targets = [
{
_label = get_label_info(":$_library_name", "label_with_toolchain")
_zircon_public = "lib"
forward_variables_from(invoker, [ "testonly" ])
import = "//build/zircon/zircon_library.gni"
target_type = "zircon_library"
......@@ -1458,6 +1459,8 @@ template("host_tool") {
legacy_dirs = [ "tool/$target_name" ]
legacy_targets = [
{
_label = get_label_info(":$target_name", "label_with_toolchain")
_zircon_public = "tool"
import = "//build/zircon/zircon_host_tool.gni"
target_type = "zircon_host_tool"
target_name = target_name
......
......@@ -142,6 +142,8 @@ template("banjo_library") {
legacy_dirs = [ "banjo/$banjo_target" ]
legacy_targets = [
{
_label = get_label_info(":$target_name", "label_with_toolchain")
_zircon_public = "banjo"
import = "//build/banjo/banjo.gni"
target_name = banjo_target
target_type = target_type
......
......@@ -248,6 +248,8 @@ template("fidl_library") {
legacy_dirs = [ "fidl/$fidl_target" ]
legacy_targets = [
{
_label = get_label_info(":$target_name", "label_with_toolchain")
_zircon_public = "fidl"
import = "//build/fidl/fidl.gni"
target_type = "fidl"
target_name = fidl_target
......
......@@ -173,6 +173,8 @@ if (toolchain.environment != "user") {
legacy_barrier = []
legacy_targets = [
{
_label = get_label_info(":$target_name", "label_with_toolchain")
_zircon_public = "lib"
target_name = "zircon"
libs = []
libs = [ rebase_path(link_file, root_build_dir) ]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment