Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(176)

Unified Diff: build/config/BUILDCONFIG.gn

Issue 1800703002: Forward visibility explicitly in GN component. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ozone Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ui/ozone/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/BUILDCONFIG.gn
diff --git a/build/config/BUILDCONFIG.gn b/build/config/BUILDCONFIG.gn
index a868fbdb2bad3645ad8988b952d44251f1d0f872..2e7f8782ffe4e70fd67f18baa301c13105f3257f 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).
« no previous file with comments | « no previous file | ui/ozone/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698