From 978acb8d5eff56d924fef6af63582ccf2497b437 Mon Sep 17 00:00:00 2001 From: dpranke Date: Tue, 5 May 2015 14:16:12 -0700 Subject: [PATCH] Adjust the visibility of the standalone targets in the GN build. As part of the migration from GYP->GN, we want to make sure that we can track when new targets are added to either the GYP or GN builds and that we are building everything we expect to build. In GN, unlike GYP, if a build file gets referenced from other files, building 'all' will cause every target to be built in it. This means in particular, that we can end up trying to build targets that are not necessarily intended to be visible to the rest of the build. To get around this, any target that is defined but hidden (like 'v8_snapshot', in V8's case) should still be visible to a top-level target called "//:gn_visibility". R=brettw@chromium.org, machenbach@chromium.org BUG=461019 LOG=N Review URL: https://codereview.chromium.org/1120093005 Cr-Commit-Position: refs/heads/master@{#28243} --- BUILD.gn | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index 233499b..9b52661 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -338,7 +338,12 @@ if (v8_use_external_startup_data) { } action("postmortem-metadata") { - visibility = [ ":*" ] # Only targets in this file can depend on this. + # Only targets in this file and the top-level visibility target can + # depend on this. + visibility = [ + ":*", + "//:gn_visibility", + ] script = "tools/gen-postmortem-metadata.py" @@ -423,7 +428,12 @@ source_set("v8_nosnapshot") { } source_set("v8_snapshot") { - visibility = [ ":*" ] # Only targets in this file can depend on this. + # Only targets in this file and the top-level visibility target can + # depend on this. + visibility = [ + ":*", + "//:gn_visibility", + ] deps = [ ":js2c", -- 2.7.4