From 58c2b3a90b634d71ccc8de68417789f21a59a6eb Mon Sep 17 00:00:00 2001 From: brettw Date: Mon, 14 Mar 2016 12:35:56 -0700 Subject: 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} --- build/config/BUILDCONFIG.gn | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'build') 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). -- cgit v1.1