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}
This commit is contained in:
dpranke 2015-05-05 14:16:12 -07:00 committed by Commit bot
parent cf53fed972
commit 978acb8d5e

View File

@ -338,7 +338,12 @@ if (v8_use_external_startup_data) {
} }
action("postmortem-metadata") { 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" script = "tools/gen-postmortem-metadata.py"
@ -423,7 +428,12 @@ source_set("v8_nosnapshot") {
} }
source_set("v8_snapshot") { 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 = [ deps = [
":js2c", ":js2c",