Chromium Code Reviews| Index: tools/gn/docs/reference.md |
| diff --git a/tools/gn/docs/reference.md b/tools/gn/docs/reference.md |
| index 657796abc8fb4e71a7561473fc03874a46ec3e5e..f5ff3b4cbc6eebd68189b4344d853e66a21a4d5c 100644 |
| --- a/tools/gn/docs/reference.md |
| +++ b/tools/gn/docs/reference.md |
| @@ -378,6 +378,10 @@ |
| Shows the labels of configs applied to targets that depend on this |
| one (either directly or all of them). |
| + forward_dependent_configs_from |
|
brettw
2015/10/14 17:45:56
I think this is a merge mistake and that Thiago re
Bons
2015/10/14 18:03:42
Done.
|
| + Shows the labels of dependencies for which dependent configs will |
| + be pushed to targets depending on the current one. |
| + |
| script |
| args |
| depfile |
| @@ -1025,14 +1029,15 @@ |
| ### **Variables valid in a config definition**: |
| ``` |
| Flags: cflags, cflags_c, cflags_cc, cflags_objc, cflags_objcc, |
| - defines, include_dirs, ldflags, lib_dirs, libs, |
| + asmflags, defines, include_dirs, ldflags, lib_dirs, libs, |
| precompiled_header, precompiled_source |
| ``` |
| ### **Variables on a target used to apply configs**: |
| ``` |
| - all_dependent_configs, configs, public_configs |
| + all_dependent_configs, configs, public_configs, |
| + forward_dependent_configs_from |
| ``` |
| @@ -1223,9 +1228,9 @@ |
| ``` |
| Flags: cflags, cflags_c, cflags_cc, cflags_objc, cflags_objcc, |
| - defines, include_dirs, ldflags, lib_dirs, libs, |
| + asmflags, defines, include_dirs, ldflags, lib_dirs, libs, |
| precompiled_header, precompiled_source |
| - Deps: data_deps, deps, public_deps |
| + Deps: data_deps, deps, forward_dependent_configs_from, public_deps |
| Dependent configs: all_dependent_configs, public_configs |
| General: check_includes, configs, data, inputs, output_name, |
| output_extension, public, sources, testonly, visibility |
| @@ -1582,14 +1587,16 @@ |
| specify configs that apply to their dependents. |
| Depending on a group is exactly like depending directly on that |
| - group's deps. |
| + group's deps. Direct dependent configs will get automatically |
| + forwarded through the group so you shouldn't need to use |
| + "forward_dependent_configs_from. |
| ``` |
| ### **Variables** |
| ``` |
| - Deps: data_deps, deps, public_deps |
| + Deps: data_deps, deps, forward_dependent_configs_from, public_deps |
| Dependent configs: all_dependent_configs, public_configs |
| ``` |
| @@ -1996,9 +2003,9 @@ |
| ``` |
| Flags: cflags, cflags_c, cflags_cc, cflags_objc, cflags_objcc, |
| - defines, include_dirs, ldflags, lib_dirs, libs, |
| + asmflags, defines, include_dirs, ldflags, lib_dirs, libs, |
| precompiled_header, precompiled_source |
| - Deps: data_deps, deps, public_deps |
| + Deps: data_deps, deps, forward_dependent_configs_from, public_deps |
| Dependent configs: all_dependent_configs, public_configs |
| General: check_includes, configs, data, inputs, output_name, |
| output_extension, public, sources, testonly, visibility |
| @@ -2037,9 +2044,9 @@ |
| ``` |
| Flags: cflags, cflags_c, cflags_cc, cflags_objc, cflags_objcc, |
| - defines, include_dirs, ldflags, lib_dirs, libs, |
| + asmflags, defines, include_dirs, ldflags, lib_dirs, libs, |
| precompiled_header, precompiled_source |
| - Deps: data_deps, deps, public_deps |
| + Deps: data_deps, deps, forward_dependent_configs_from, public_deps |
| Dependent configs: all_dependent_configs, public_configs |
| General: check_includes, configs, data, inputs, output_name, |
| output_extension, public, sources, testonly, visibility |
| @@ -2061,9 +2068,9 @@ |
| ``` |
| Flags: cflags, cflags_c, cflags_cc, cflags_objc, cflags_objcc, |
| - defines, include_dirs, ldflags, lib_dirs, libs, |
| + asmflags, defines, include_dirs, ldflags, lib_dirs, libs, |
| precompiled_header, precompiled_source |
| - Deps: data_deps, deps, public_deps |
| + Deps: data_deps, deps, forward_dependent_configs_from, public_deps |
| Dependent configs: all_dependent_configs, public_configs |
| General: check_includes, configs, data, inputs, output_name, |
| output_extension, public, sources, testonly, visibility |
| @@ -2511,6 +2518,7 @@ |
| along with a set of compiler-specific flags. The following expansions |
| are available: |
| + {{asmflags}} |
| {{cflags}} |
| {{cflags_c}} |
| {{cflags_cc}} |
| @@ -3217,8 +3225,11 @@ |
| and Objective C++ compilers. |
| To target one of these variants individually, use "cflags_c", |
| - "cflags_cc", "cflags_objc", and "cflags_objcc", respectively. |
| - These variant-specific versions will be appended to the "cflags". |
| + "cflags_cc", "cflags_objc", and "cflags_objcc", |
| + respectively. |
| + |
| + These variant-specific versions of cflags* will be appended to the |
| + "cflags". |
| ``` |
| @@ -3250,8 +3261,11 @@ |
| and Objective C++ compilers. |
| To target one of these variants individually, use "cflags_c", |
| - "cflags_cc", "cflags_objc", and "cflags_objcc", respectively. |
| - These variant-specific versions will be appended to the "cflags". |
| + "cflags_cc", "cflags_objc", and "cflags_objcc", |
| + respectively. |
| + |
| + These variant-specific versions of cflags* will be appended to the |
| + "cflags". |
| ``` |
| @@ -3283,8 +3297,11 @@ |
| and Objective C++ compilers. |
| To target one of these variants individually, use "cflags_c", |
| - "cflags_cc", "cflags_objc", and "cflags_objcc", respectively. |
| - These variant-specific versions will be appended to the "cflags". |
| + "cflags_cc", "cflags_objc", and "cflags_objcc", |
| + respectively. |
| + |
| + These variant-specific versions of cflags* will be appended to the |
| + "cflags". |
| ``` |
| @@ -3316,8 +3333,11 @@ |
| and Objective C++ compilers. |
| To target one of these variants individually, use "cflags_c", |
| - "cflags_cc", "cflags_objc", and "cflags_objcc", respectively. |
| - These variant-specific versions will be appended to the "cflags". |
| + "cflags_cc", "cflags_objc", and "cflags_objcc", |
| + respectively. |
| + |
| + These variant-specific versions of cflags* will be appended to the |
| + "cflags". |
| ``` |
| @@ -3349,8 +3369,11 @@ |
| and Objective C++ compilers. |
| To target one of these variants individually, use "cflags_c", |
| - "cflags_cc", "cflags_objc", and "cflags_objcc", respectively. |
| - These variant-specific versions will be appended to the "cflags". |
| + "cflags_cc", "cflags_objc", and "cflags_objcc", |
| + respectively. |
| + |
| + These variant-specific versions of cflags* will be appended to the |
| + "cflags". |
| ``` |
| @@ -3718,6 +3741,56 @@ |
| ``` |
| +## **forward_dependent_configs_from** |
| + |
| +``` |
| + A list of target labels. |
| + |
| + DEPRECATED. Use public_deps instead which will have the same effect. |
| + |
| + Exposes the public_configs from a private dependent target as |
| + public_configs of the current one. Each label in this list |
| + must also be in the deps. |
| + |
| + Generally you should use public_deps instead of this variable to |
| + express the concept of exposing a dependency as part of a target's |
| + public API. We're considering removing this variable. |
| + |
| +``` |
| + |
| +### **Discussion** |
| + |
| +``` |
| + Sometimes you depend on a child library that exports some necessary |
| + configuration via public_configs. If your target in turn exposes the |
| + child library's headers in its public headers, it might mean that |
| + targets that depend on you won't work: they'll be seeing the child |
| + library's code but not the necessary configuration. This list |
| + specifies which of your deps' direct dependent configs to expose as |
| + your own. |
| + |
| +``` |
| + |
| +### **Examples** |
| + |
| +``` |
| + If we use a given library "a" from our public headers: |
| + |
| + deps = [ ":a", ":b", ... ] |
| + forward_dependent_configs_from = [ ":a" ] |
| + |
| + This example makes a "transparent" target that forwards a dependency |
| + to another: |
| + |
| + group("frob") { |
| + if (use_system_frob) { |
| + deps = ":system_frob" |
| + } else { |
| + deps = "//third_party/fallback_frob" |
| + } |
| + forward_dependent_configs_from = deps |
| + } |
| + |
| ``` |
| ## **include_dirs**: Additional include directories. |