summaryrefslogtreecommitdiffstats
path: root/build
diff options
context:
space:
mode:
authorbrettw <brettw@chromium.org>2016-03-14 12:35:56 -0700
committerCommit bot <commit-bot@chromium.org>2016-03-14 19:37:23 +0000
commit58c2b3a90b634d71ccc8de68417789f21a59a6eb (patch)
treef5f97a778f82972af2c0066e810dd900c12590c0 /build
parent5f2749ad8b99fe331d5c08ae6a4fdfafb1156e78 (diff)
downloadchromium_src-58c2b3a90b634d71ccc8de68417789f21a59a6eb.zip
chromium_src-58c2b3a90b634d71ccc8de68417789f21a59a6eb.tar.gz
chromium_src-58c2b3a90b634d71ccc8de68417789f21a59a6eb.tar.bz2
Forward visibility explicitly in GN component.
As described in the added comment, this picks up file-scope visibility in components, where before it did not apply. Fixes //ui/ozone:ozone's visibility which was not being applied because of this. I believe the intent of the ozone target is to be public and the rest should be file-local. BUG=594610 Review URL: https://codereview.chromium.org/1800703002 Cr-Commit-Position: refs/heads/master@{#381043}
Diffstat (limited to 'build')
-rw-r--r--build/config/BUILDCONFIG.gn10
1 files changed, 9 insertions, 1 deletions
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index a868fbd..2e7f878 100644
--- a/build/config/BUILDCONFIG.gn
+++ b/build/config/BUILDCONFIG.gn
@@ -600,7 +600,15 @@ template("component") {
_component_mode = "source_set"
}
target(_component_mode, target_name) {
- forward_variables_from(invoker, "*")
+ # Explicitly forward visibility, implicitly forward everything else.
+ # Forwarding "*" doesn't recurse into nested scopes (to avoid copying all
+ # globals into each template invocation), so won't pick up file-scoped
+ # variables. Normally this isn't too bad, but visibility is commonly
+ # defined at the file scope. Explicitly forwarding visibility and then
+ # excluding it from the "*" set works around this problem.
+ # See http://crbug.com/594610
+ forward_variables_from(invoker, [ "visibility" ])
+ forward_variables_from(invoker, "*", [ "visibility" ])
# All shared libraries must have the sanitizer deps to properly link in
# asan mode (this target will be empty in other cases).