Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # GN Reference | 1 # GN Reference |
| 2 | 2 |
| 3 *This page is automatically generated from* `gn help --markdown all`. | 3 *This page is automatically generated from* `gn help --markdown all`. |
| 4 | 4 |
| 5 ## **\--args**: Specifies build arguments overrides. | 5 ## **\--args**: Specifies build arguments overrides. |
| 6 | 6 |
| 7 ``` | 7 ``` |
| 8 See "gn help buildargs" for an overview of how build arguments work. | 8 See "gn help buildargs" for an overview of how build arguments work. |
| 9 | 9 |
| 10 Most operations take a build directory. The build arguments are taken | 10 Most operations take a build directory. The build arguments are taken |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 371 | 371 |
| 372 deps | 372 deps |
| 373 Show immediate or recursive dependencies. See below for flags that | 373 Show immediate or recursive dependencies. See below for flags that |
| 374 control deps printing. | 374 control deps printing. |
| 375 | 375 |
| 376 public_configs | 376 public_configs |
| 377 all_dependent_configs | 377 all_dependent_configs |
| 378 Shows the labels of configs applied to targets that depend on this | 378 Shows the labels of configs applied to targets that depend on this |
| 379 one (either directly or all of them). | 379 one (either directly or all of them). |
| 380 | 380 |
| 381 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.
| |
| 382 Shows the labels of dependencies for which dependent configs will | |
| 383 be pushed to targets depending on the current one. | |
| 384 | |
| 381 script | 385 script |
| 382 args | 386 args |
| 383 depfile | 387 depfile |
| 384 Actions only. The script and related values. | 388 Actions only. The script and related values. |
| 385 | 389 |
| 386 outputs | 390 outputs |
| 387 Outputs for script and copy target types. | 391 Outputs for script and copy target types. |
| 388 | 392 |
| 389 defines [--blame] | 393 defines [--blame] |
| 390 include_dirs [--blame] | 394 include_dirs [--blame] |
| (...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1018 3. Public_configs from a breadth-first traversal of the dependency | 1022 3. Public_configs from a breadth-first traversal of the dependency |
| 1019 tree in the order that the targets appear in "deps". | 1023 tree in the order that the targets appear in "deps". |
| 1020 4. All dependent configs from a breadth-first traversal of the | 1024 4. All dependent configs from a breadth-first traversal of the |
| 1021 dependency tree in the order that the targets appear in "deps". | 1025 dependency tree in the order that the targets appear in "deps". |
| 1022 | 1026 |
| 1023 ``` | 1027 ``` |
| 1024 | 1028 |
| 1025 ### **Variables valid in a config definition**: | 1029 ### **Variables valid in a config definition**: |
| 1026 ``` | 1030 ``` |
| 1027 Flags: cflags, cflags_c, cflags_cc, cflags_objc, cflags_objcc, | 1031 Flags: cflags, cflags_c, cflags_cc, cflags_objc, cflags_objcc, |
| 1028 defines, include_dirs, ldflags, lib_dirs, libs, | 1032 asmflags, defines, include_dirs, ldflags, lib_dirs, libs, |
| 1029 precompiled_header, precompiled_source | 1033 precompiled_header, precompiled_source |
| 1030 | 1034 |
| 1031 ``` | 1035 ``` |
| 1032 | 1036 |
| 1033 ### **Variables on a target used to apply configs**: | 1037 ### **Variables on a target used to apply configs**: |
| 1034 ``` | 1038 ``` |
| 1035 all_dependent_configs, configs, public_configs | 1039 all_dependent_configs, configs, public_configs, |
| 1040 forward_dependent_configs_from | |
| 1036 | 1041 |
| 1037 ``` | 1042 ``` |
| 1038 | 1043 |
| 1039 ### **Example**: | 1044 ### **Example**: |
| 1040 ``` | 1045 ``` |
| 1041 config("myconfig") { | 1046 config("myconfig") { |
| 1042 includes = [ "include/common" ] | 1047 includes = [ "include/common" ] |
| 1043 defines = [ "ENABLE_DOOM_MELON" ] | 1048 defines = [ "ENABLE_DOOM_MELON" ] |
| 1044 } | 1049 } |
| 1045 | 1050 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1216 exec_script("//foo/bar/myscript.py") | 1221 exec_script("//foo/bar/myscript.py") |
| 1217 | 1222 |
| 1218 | 1223 |
| 1219 ``` | 1224 ``` |
| 1220 ## **executable**: Declare an executable target. | 1225 ## **executable**: Declare an executable target. |
| 1221 | 1226 |
| 1222 ### **Variables** | 1227 ### **Variables** |
| 1223 | 1228 |
| 1224 ``` | 1229 ``` |
| 1225 Flags: cflags, cflags_c, cflags_cc, cflags_objc, cflags_objcc, | 1230 Flags: cflags, cflags_c, cflags_cc, cflags_objc, cflags_objcc, |
| 1226 defines, include_dirs, ldflags, lib_dirs, libs, | 1231 asmflags, defines, include_dirs, ldflags, lib_dirs, libs, |
| 1227 precompiled_header, precompiled_source | 1232 precompiled_header, precompiled_source |
| 1228 Deps: data_deps, deps, public_deps | 1233 Deps: data_deps, deps, forward_dependent_configs_from, public_deps |
| 1229 Dependent configs: all_dependent_configs, public_configs | 1234 Dependent configs: all_dependent_configs, public_configs |
| 1230 General: check_includes, configs, data, inputs, output_name, | 1235 General: check_includes, configs, data, inputs, output_name, |
| 1231 output_extension, public, sources, testonly, visibility | 1236 output_extension, public, sources, testonly, visibility |
| 1232 | 1237 |
| 1233 | 1238 |
| 1234 ``` | 1239 ``` |
| 1235 ## **foreach**: Iterate over a list. | 1240 ## **foreach**: Iterate over a list. |
| 1236 | 1241 |
| 1237 ``` | 1242 ``` |
| 1238 foreach(<loop_var>, <list>) { | 1243 foreach(<loop_var>, <list>) { |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1575 | 1580 |
| 1576 ``` | 1581 ``` |
| 1577 ## **group**: Declare a named group of targets. | 1582 ## **group**: Declare a named group of targets. |
| 1578 | 1583 |
| 1579 ``` | 1584 ``` |
| 1580 This target type allows you to create meta-targets that just collect a | 1585 This target type allows you to create meta-targets that just collect a |
| 1581 set of dependencies into one named target. Groups can additionally | 1586 set of dependencies into one named target. Groups can additionally |
| 1582 specify configs that apply to their dependents. | 1587 specify configs that apply to their dependents. |
| 1583 | 1588 |
| 1584 Depending on a group is exactly like depending directly on that | 1589 Depending on a group is exactly like depending directly on that |
| 1585 group's deps. | 1590 group's deps. Direct dependent configs will get automatically |
| 1591 forwarded through the group so you shouldn't need to use | |
| 1592 "forward_dependent_configs_from. | |
| 1586 | 1593 |
| 1587 ``` | 1594 ``` |
| 1588 | 1595 |
| 1589 ### **Variables** | 1596 ### **Variables** |
| 1590 | 1597 |
| 1591 ``` | 1598 ``` |
| 1592 Deps: data_deps, deps, public_deps | 1599 Deps: data_deps, deps, forward_dependent_configs_from, public_deps |
| 1593 Dependent configs: all_dependent_configs, public_configs | 1600 Dependent configs: all_dependent_configs, public_configs |
| 1594 | 1601 |
| 1595 ``` | 1602 ``` |
| 1596 | 1603 |
| 1597 ### **Example** | 1604 ### **Example** |
| 1598 | 1605 |
| 1599 ``` | 1606 ``` |
| 1600 group("all") { | 1607 group("all") { |
| 1601 deps = [ | 1608 deps = [ |
| 1602 "//project:runner", | 1609 "//project:runner", |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1989 listing the shared library in its "deps". If you don't want this | 1996 listing the shared library in its "deps". If you don't want this |
| 1990 (say you dynamically load the library at runtime), then you should | 1997 (say you dynamically load the library at runtime), then you should |
| 1991 depend on the shared library via "data_deps" instead. | 1998 depend on the shared library via "data_deps" instead. |
| 1992 | 1999 |
| 1993 ``` | 2000 ``` |
| 1994 | 2001 |
| 1995 ### **Variables** | 2002 ### **Variables** |
| 1996 | 2003 |
| 1997 ``` | 2004 ``` |
| 1998 Flags: cflags, cflags_c, cflags_cc, cflags_objc, cflags_objcc, | 2005 Flags: cflags, cflags_c, cflags_cc, cflags_objc, cflags_objcc, |
| 1999 defines, include_dirs, ldflags, lib_dirs, libs, | 2006 asmflags, defines, include_dirs, ldflags, lib_dirs, libs, |
| 2000 precompiled_header, precompiled_source | 2007 precompiled_header, precompiled_source |
| 2001 Deps: data_deps, deps, public_deps | 2008 Deps: data_deps, deps, forward_dependent_configs_from, public_deps |
| 2002 Dependent configs: all_dependent_configs, public_configs | 2009 Dependent configs: all_dependent_configs, public_configs |
| 2003 General: check_includes, configs, data, inputs, output_name, | 2010 General: check_includes, configs, data, inputs, output_name, |
| 2004 output_extension, public, sources, testonly, visibility | 2011 output_extension, public, sources, testonly, visibility |
| 2005 | 2012 |
| 2006 | 2013 |
| 2007 ``` | 2014 ``` |
| 2008 ## **source_set**: Declare a source set target. | 2015 ## **source_set**: Declare a source set target. |
| 2009 | 2016 |
| 2010 ``` | 2017 ``` |
| 2011 A source set is a collection of sources that get compiled, but are not | 2018 A source set is a collection of sources that get compiled, but are not |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 2030 final shared library and not from the intermediate targets." There is | 2037 final shared library and not from the intermediate targets." There is |
| 2031 no way to express this concept when linking multiple static libraries | 2038 no way to express this concept when linking multiple static libraries |
| 2032 into a shared library. | 2039 into a shared library. |
| 2033 | 2040 |
| 2034 ``` | 2041 ``` |
| 2035 | 2042 |
| 2036 ### **Variables** | 2043 ### **Variables** |
| 2037 | 2044 |
| 2038 ``` | 2045 ``` |
| 2039 Flags: cflags, cflags_c, cflags_cc, cflags_objc, cflags_objcc, | 2046 Flags: cflags, cflags_c, cflags_cc, cflags_objc, cflags_objcc, |
| 2040 defines, include_dirs, ldflags, lib_dirs, libs, | 2047 asmflags, defines, include_dirs, ldflags, lib_dirs, libs, |
| 2041 precompiled_header, precompiled_source | 2048 precompiled_header, precompiled_source |
| 2042 Deps: data_deps, deps, public_deps | 2049 Deps: data_deps, deps, forward_dependent_configs_from, public_deps |
| 2043 Dependent configs: all_dependent_configs, public_configs | 2050 Dependent configs: all_dependent_configs, public_configs |
| 2044 General: check_includes, configs, data, inputs, output_name, | 2051 General: check_includes, configs, data, inputs, output_name, |
| 2045 output_extension, public, sources, testonly, visibility | 2052 output_extension, public, sources, testonly, visibility |
| 2046 | 2053 |
| 2047 | 2054 |
| 2048 ``` | 2055 ``` |
| 2049 ## **static_library**: Declare a static library target. | 2056 ## **static_library**: Declare a static library target. |
| 2050 | 2057 |
| 2051 ``` | 2058 ``` |
| 2052 Make a ".a" / ".lib" file. | 2059 Make a ".a" / ".lib" file. |
| 2053 | 2060 |
| 2054 If you only need the static library for intermediate results in the | 2061 If you only need the static library for intermediate results in the |
| 2055 build, you should consider a source_set instead since it will skip | 2062 build, you should consider a source_set instead since it will skip |
| 2056 the (potentially slow) step of creating the intermediate library file. | 2063 the (potentially slow) step of creating the intermediate library file. |
| 2057 | 2064 |
| 2058 ``` | 2065 ``` |
| 2059 | 2066 |
| 2060 ### **Variables** | 2067 ### **Variables** |
| 2061 | 2068 |
| 2062 ``` | 2069 ``` |
| 2063 Flags: cflags, cflags_c, cflags_cc, cflags_objc, cflags_objcc, | 2070 Flags: cflags, cflags_c, cflags_cc, cflags_objc, cflags_objcc, |
| 2064 defines, include_dirs, ldflags, lib_dirs, libs, | 2071 asmflags, defines, include_dirs, ldflags, lib_dirs, libs, |
| 2065 precompiled_header, precompiled_source | 2072 precompiled_header, precompiled_source |
| 2066 Deps: data_deps, deps, public_deps | 2073 Deps: data_deps, deps, forward_dependent_configs_from, public_deps |
| 2067 Dependent configs: all_dependent_configs, public_configs | 2074 Dependent configs: all_dependent_configs, public_configs |
| 2068 General: check_includes, configs, data, inputs, output_name, | 2075 General: check_includes, configs, data, inputs, output_name, |
| 2069 output_extension, public, sources, testonly, visibility | 2076 output_extension, public, sources, testonly, visibility |
| 2070 | 2077 |
| 2071 | 2078 |
| 2072 ``` | 2079 ``` |
| 2073 ## **target**: Declare an target with the given programmatic type. | 2080 ## **target**: Declare an target with the given programmatic type. |
| 2074 | 2081 |
| 2075 ``` | 2082 ``` |
| 2076 target(target_type_string, target_name_string) { ... } | 2083 target(target_type_string, target_name_string) { ... } |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2504 The short name of the current target with no path information, | 2511 The short name of the current target with no path information, |
| 2505 or the value of the "output_name" variable if one is specified | 2512 or the value of the "output_name" variable if one is specified |
| 2506 in the target. This will include the "output_prefix" if any. | 2513 in the target. This will include the "output_prefix" if any. |
| 2507 Example: "libfoo" for the target named "foo" and an | 2514 Example: "libfoo" for the target named "foo" and an |
| 2508 output prefix for the linker tool of "lib". | 2515 output prefix for the linker tool of "lib". |
| 2509 | 2516 |
| 2510 Compiler tools have the notion of a single input and a single output, | 2517 Compiler tools have the notion of a single input and a single output, |
| 2511 along with a set of compiler-specific flags. The following expansions | 2518 along with a set of compiler-specific flags. The following expansions |
| 2512 are available: | 2519 are available: |
| 2513 | 2520 |
| 2521 {{asmflags}} | |
| 2514 {{cflags}} | 2522 {{cflags}} |
| 2515 {{cflags_c}} | 2523 {{cflags_c}} |
| 2516 {{cflags_cc}} | 2524 {{cflags_cc}} |
| 2517 {{cflags_objc}} | 2525 {{cflags_objc}} |
| 2518 {{cflags_objcc}} | 2526 {{cflags_objcc}} |
| 2519 {{defines}} | 2527 {{defines}} |
| 2520 {{include_dirs}} | 2528 {{include_dirs}} |
| 2521 Strings correspond that to the processed flags/defines/include | 2529 Strings correspond that to the processed flags/defines/include |
| 2522 directories specified for the target. | 2530 directories specified for the target. |
| 2523 Example: "--enable-foo --enable-bar" | 2531 Example: "--enable-foo --enable-bar" |
| (...skipping 686 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3210 ``` | 3218 ``` |
| 3211 ## **cflags***: Flags passed to the C compiler. | 3219 ## **cflags***: Flags passed to the C compiler. |
| 3212 | 3220 |
| 3213 ``` | 3221 ``` |
| 3214 A list of strings. | 3222 A list of strings. |
| 3215 | 3223 |
| 3216 "cflags" are passed to all invocations of the C, C++, Objective C, | 3224 "cflags" are passed to all invocations of the C, C++, Objective C, |
| 3217 and Objective C++ compilers. | 3225 and Objective C++ compilers. |
| 3218 | 3226 |
| 3219 To target one of these variants individually, use "cflags_c", | 3227 To target one of these variants individually, use "cflags_c", |
| 3220 "cflags_cc", "cflags_objc", and "cflags_objcc", respectively. | 3228 "cflags_cc", "cflags_objc", and "cflags_objcc", |
| 3221 These variant-specific versions will be appended to the "cflags". | 3229 respectively. |
| 3230 | |
| 3231 These variant-specific versions of cflags* will be appended to the | |
| 3232 "cflags". | |
| 3222 | 3233 |
| 3223 ``` | 3234 ``` |
| 3224 | 3235 |
| 3225 ### **Ordering of flags and values** | 3236 ### **Ordering of flags and values** |
| 3226 | 3237 |
| 3227 ``` | 3238 ``` |
| 3228 1. Those set on the current target (not in a config). | 3239 1. Those set on the current target (not in a config). |
| 3229 2. Those set on the "configs" on the target in order that the | 3240 2. Those set on the "configs" on the target in order that the |
| 3230 configs appear in the list. | 3241 configs appear in the list. |
| 3231 3. Those set on the "all_dependent_configs" on the target in order | 3242 3. Those set on the "all_dependent_configs" on the target in order |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 3243 ``` | 3254 ``` |
| 3244 ## **cflags***: Flags passed to the C compiler. | 3255 ## **cflags***: Flags passed to the C compiler. |
| 3245 | 3256 |
| 3246 ``` | 3257 ``` |
| 3247 A list of strings. | 3258 A list of strings. |
| 3248 | 3259 |
| 3249 "cflags" are passed to all invocations of the C, C++, Objective C, | 3260 "cflags" are passed to all invocations of the C, C++, Objective C, |
| 3250 and Objective C++ compilers. | 3261 and Objective C++ compilers. |
| 3251 | 3262 |
| 3252 To target one of these variants individually, use "cflags_c", | 3263 To target one of these variants individually, use "cflags_c", |
| 3253 "cflags_cc", "cflags_objc", and "cflags_objcc", respectively. | 3264 "cflags_cc", "cflags_objc", and "cflags_objcc", |
| 3254 These variant-specific versions will be appended to the "cflags". | 3265 respectively. |
| 3266 | |
| 3267 These variant-specific versions of cflags* will be appended to the | |
| 3268 "cflags". | |
| 3255 | 3269 |
| 3256 ``` | 3270 ``` |
| 3257 | 3271 |
| 3258 ### **Ordering of flags and values** | 3272 ### **Ordering of flags and values** |
| 3259 | 3273 |
| 3260 ``` | 3274 ``` |
| 3261 1. Those set on the current target (not in a config). | 3275 1. Those set on the current target (not in a config). |
| 3262 2. Those set on the "configs" on the target in order that the | 3276 2. Those set on the "configs" on the target in order that the |
| 3263 configs appear in the list. | 3277 configs appear in the list. |
| 3264 3. Those set on the "all_dependent_configs" on the target in order | 3278 3. Those set on the "all_dependent_configs" on the target in order |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 3276 ``` | 3290 ``` |
| 3277 ## **cflags***: Flags passed to the C compiler. | 3291 ## **cflags***: Flags passed to the C compiler. |
| 3278 | 3292 |
| 3279 ``` | 3293 ``` |
| 3280 A list of strings. | 3294 A list of strings. |
| 3281 | 3295 |
| 3282 "cflags" are passed to all invocations of the C, C++, Objective C, | 3296 "cflags" are passed to all invocations of the C, C++, Objective C, |
| 3283 and Objective C++ compilers. | 3297 and Objective C++ compilers. |
| 3284 | 3298 |
| 3285 To target one of these variants individually, use "cflags_c", | 3299 To target one of these variants individually, use "cflags_c", |
| 3286 "cflags_cc", "cflags_objc", and "cflags_objcc", respectively. | 3300 "cflags_cc", "cflags_objc", and "cflags_objcc", |
| 3287 These variant-specific versions will be appended to the "cflags". | 3301 respectively. |
| 3302 | |
| 3303 These variant-specific versions of cflags* will be appended to the | |
| 3304 "cflags". | |
| 3288 | 3305 |
| 3289 ``` | 3306 ``` |
| 3290 | 3307 |
| 3291 ### **Ordering of flags and values** | 3308 ### **Ordering of flags and values** |
| 3292 | 3309 |
| 3293 ``` | 3310 ``` |
| 3294 1. Those set on the current target (not in a config). | 3311 1. Those set on the current target (not in a config). |
| 3295 2. Those set on the "configs" on the target in order that the | 3312 2. Those set on the "configs" on the target in order that the |
| 3296 configs appear in the list. | 3313 configs appear in the list. |
| 3297 3. Those set on the "all_dependent_configs" on the target in order | 3314 3. Those set on the "all_dependent_configs" on the target in order |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 3309 ``` | 3326 ``` |
| 3310 ## **cflags***: Flags passed to the C compiler. | 3327 ## **cflags***: Flags passed to the C compiler. |
| 3311 | 3328 |
| 3312 ``` | 3329 ``` |
| 3313 A list of strings. | 3330 A list of strings. |
| 3314 | 3331 |
| 3315 "cflags" are passed to all invocations of the C, C++, Objective C, | 3332 "cflags" are passed to all invocations of the C, C++, Objective C, |
| 3316 and Objective C++ compilers. | 3333 and Objective C++ compilers. |
| 3317 | 3334 |
| 3318 To target one of these variants individually, use "cflags_c", | 3335 To target one of these variants individually, use "cflags_c", |
| 3319 "cflags_cc", "cflags_objc", and "cflags_objcc", respectively. | 3336 "cflags_cc", "cflags_objc", and "cflags_objcc", |
| 3320 These variant-specific versions will be appended to the "cflags". | 3337 respectively. |
| 3338 | |
| 3339 These variant-specific versions of cflags* will be appended to the | |
| 3340 "cflags". | |
| 3321 | 3341 |
| 3322 ``` | 3342 ``` |
| 3323 | 3343 |
| 3324 ### **Ordering of flags and values** | 3344 ### **Ordering of flags and values** |
| 3325 | 3345 |
| 3326 ``` | 3346 ``` |
| 3327 1. Those set on the current target (not in a config). | 3347 1. Those set on the current target (not in a config). |
| 3328 2. Those set on the "configs" on the target in order that the | 3348 2. Those set on the "configs" on the target in order that the |
| 3329 configs appear in the list. | 3349 configs appear in the list. |
| 3330 3. Those set on the "all_dependent_configs" on the target in order | 3350 3. Those set on the "all_dependent_configs" on the target in order |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 3342 ``` | 3362 ``` |
| 3343 ## **cflags***: Flags passed to the C compiler. | 3363 ## **cflags***: Flags passed to the C compiler. |
| 3344 | 3364 |
| 3345 ``` | 3365 ``` |
| 3346 A list of strings. | 3366 A list of strings. |
| 3347 | 3367 |
| 3348 "cflags" are passed to all invocations of the C, C++, Objective C, | 3368 "cflags" are passed to all invocations of the C, C++, Objective C, |
| 3349 and Objective C++ compilers. | 3369 and Objective C++ compilers. |
| 3350 | 3370 |
| 3351 To target one of these variants individually, use "cflags_c", | 3371 To target one of these variants individually, use "cflags_c", |
| 3352 "cflags_cc", "cflags_objc", and "cflags_objcc", respectively. | 3372 "cflags_cc", "cflags_objc", and "cflags_objcc", |
| 3353 These variant-specific versions will be appended to the "cflags". | 3373 respectively. |
| 3374 | |
| 3375 These variant-specific versions of cflags* will be appended to the | |
| 3376 "cflags". | |
| 3354 | 3377 |
| 3355 ``` | 3378 ``` |
| 3356 | 3379 |
| 3357 ### **Ordering of flags and values** | 3380 ### **Ordering of flags and values** |
| 3358 | 3381 |
| 3359 ``` | 3382 ``` |
| 3360 1. Those set on the current target (not in a config). | 3383 1. Those set on the current target (not in a config). |
| 3361 2. Those set on the "configs" on the target in order that the | 3384 2. Those set on the "configs" on the target in order that the |
| 3362 configs appear in the list. | 3385 configs appear in the list. |
| 3363 3. Those set on the "all_dependent_configs" on the target in order | 3386 3. Those set on the "all_dependent_configs" on the target in order |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3711 libraries will be linked into the current target. | 3734 libraries will be linked into the current target. |
| 3712 | 3735 |
| 3713 These dependencies are private in that it does not grant dependent | 3736 These dependencies are private in that it does not grant dependent |
| 3714 targets the ability to include headers from the dependency, and direct | 3737 targets the ability to include headers from the dependency, and direct |
| 3715 dependent configs are not forwarded. | 3738 dependent configs are not forwarded. |
| 3716 | 3739 |
| 3717 See also "public_deps" and "data_deps". | 3740 See also "public_deps" and "data_deps". |
| 3718 | 3741 |
| 3719 | 3742 |
| 3720 ``` | 3743 ``` |
| 3744 ## **forward_dependent_configs_from** | |
| 3745 | |
| 3746 ``` | |
| 3747 A list of target labels. | |
| 3748 | |
| 3749 DEPRECATED. Use public_deps instead which will have the same effect. | |
| 3750 | |
| 3751 Exposes the public_configs from a private dependent target as | |
| 3752 public_configs of the current one. Each label in this list | |
| 3753 must also be in the deps. | |
| 3754 | |
| 3755 Generally you should use public_deps instead of this variable to | |
| 3756 express the concept of exposing a dependency as part of a target's | |
| 3757 public API. We're considering removing this variable. | |
| 3758 | |
| 3759 ``` | |
| 3760 | |
| 3761 ### **Discussion** | |
| 3762 | |
| 3763 ``` | |
| 3764 Sometimes you depend on a child library that exports some necessary | |
| 3765 configuration via public_configs. If your target in turn exposes the | |
| 3766 child library's headers in its public headers, it might mean that | |
| 3767 targets that depend on you won't work: they'll be seeing the child | |
| 3768 library's code but not the necessary configuration. This list | |
| 3769 specifies which of your deps' direct dependent configs to expose as | |
| 3770 your own. | |
| 3771 | |
| 3772 ``` | |
| 3773 | |
| 3774 ### **Examples** | |
| 3775 | |
| 3776 ``` | |
| 3777 If we use a given library "a" from our public headers: | |
| 3778 | |
| 3779 deps = [ ":a", ":b", ... ] | |
| 3780 forward_dependent_configs_from = [ ":a" ] | |
| 3781 | |
| 3782 This example makes a "transparent" target that forwards a dependency | |
| 3783 to another: | |
| 3784 | |
| 3785 group("frob") { | |
| 3786 if (use_system_frob) { | |
| 3787 deps = ":system_frob" | |
| 3788 } else { | |
| 3789 deps = "//third_party/fallback_frob" | |
| 3790 } | |
| 3791 forward_dependent_configs_from = deps | |
| 3792 } | |
| 3793 | |
| 3721 | 3794 |
| 3722 ``` | 3795 ``` |
| 3723 ## **include_dirs**: Additional include directories. | 3796 ## **include_dirs**: Additional include directories. |
| 3724 | 3797 |
| 3725 ``` | 3798 ``` |
| 3726 A list of source directories. | 3799 A list of source directories. |
| 3727 | 3800 |
| 3728 The directories in this list will be added to the include path for | 3801 The directories in this list will be added to the include path for |
| 3729 the files in the affected target. | 3802 the files in the affected target. |
| 3730 | 3803 |
| (...skipping 1270 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5001 ** -q**: Quiet mode. Don't print output on success. | 5074 ** -q**: Quiet mode. Don't print output on success. |
| 5002 ** \--root**: Explicitly specify source root. | 5075 ** \--root**: Explicitly specify source root. |
| 5003 ** \--runtime-deps-list-file**: Save runtime dependencies for targets in file. | 5076 ** \--runtime-deps-list-file**: Save runtime dependencies for targets in file. |
| 5004 ** \--threads**: Specify number of worker threads. | 5077 ** \--threads**: Specify number of worker threads. |
| 5005 ** \--time**: Outputs a summary of how long everything took. | 5078 ** \--time**: Outputs a summary of how long everything took. |
| 5006 ** \--tracelog**: Writes a Chrome-compatible trace log to the given file. | 5079 ** \--tracelog**: Writes a Chrome-compatible trace log to the given file. |
| 5007 ** -v**: Verbose logging. | 5080 ** -v**: Verbose logging. |
| 5008 ** \--version**: Prints the GN version number and exits. | 5081 ** \--version**: Prints the GN version number and exits. |
| 5009 | 5082 |
| 5010 ``` | 5083 ``` |
| OLD | NEW |