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 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1038 ## **copy**: Declare a target that copies files. | 1038 ## **copy**: Declare a target that copies files. |
| 1039 | 1039 |
| 1040 ### **File name handling** | 1040 ### **File name handling** |
| 1041 | 1041 |
| 1042 ``` | 1042 ``` |
| 1043 All output files must be inside the output directory of the build. | 1043 All output files must be inside the output directory of the build. |
| 1044 You would generally use |$target_out_dir| or |$target_gen_dir| to | 1044 You would generally use |$target_out_dir| or |$target_gen_dir| to |
| 1045 reference the output or generated intermediate file directories, | 1045 reference the output or generated intermediate file directories, |
| 1046 respectively. | 1046 respectively. |
| 1047 | 1047 |
| 1048 Both "sources" and "outputs" must be specified. Sources can | 1048 Both "sources" and "outputs" must be specified. Sources can include |
| 1049 as many files as you want, but there can only be one item in the | 1049 as many files as you want, but there can only be one item in the |
| 1050 outputs list (plural is used for the name for consistency with | 1050 outputs list (plural is used for the name for consistency with |
| 1051 other target types). | 1051 other target types). |
| 1052 | 1052 |
| 1053 If there is more than one source file, your output name should specify | 1053 If there is more than one source file, your output name should specify |
| 1054 a mapping from each source files to output file names using source | 1054 a mapping from each source file to an output file name using source |
| 1055 expansion (see "gn help source_expansion"). The placeholders will | 1055 expansion (see "gn help source_expansion"). The placeholders will |
| 1056 will look like "{{source_name_part}}", for example. | 1056 look like "{{source_name_part}}", for example. |
| 1057 | 1057 |
| 1058 ``` | 1058 ``` |
| 1059 | 1059 |
| 1060 ### **Examples** | 1060 ### **Examples** |
| 1061 | 1061 |
| 1062 ``` | 1062 ``` |
| 1063 # Write a rule that copies a checked-in DLL to the output directory. | 1063 # Write a rule that copies a checked-in DLL to the output directory. |
| 1064 copy("mydll") { | 1064 copy("mydll") { |
| 1065 sources = [ "mydll.dll" ] | 1065 sources = [ "mydll.dll" ] |
| 1066 outputs = [ "$target_out_dir/mydll.dll" ] | 1066 outputs = [ "$target_out_dir/mydll.dll" ] |
| (...skipping 2444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3511 See "gn help runtime_deps" for how these are used. | 3511 See "gn help runtime_deps" for how these are used. |
| 3512 | 3512 |
| 3513 | 3513 |
| 3514 ``` | 3514 ``` |
| 3515 ## **data_deps**: Non-linked dependencies. | 3515 ## **data_deps**: Non-linked dependencies. |
| 3516 | 3516 |
| 3517 ``` | 3517 ``` |
| 3518 A list of target labels. | 3518 A list of target labels. |
| 3519 | 3519 |
| 3520 Specifies dependencies of a target that are not actually linked into | 3520 Specifies dependencies of a target that are not actually linked into |
| 3521 the current target. Such dependencies will be built and will be available | 3521 the current target. Such dependencies will be built and will be |
| 3522 at runtime. | 3522 available at runtime. |
| 3523 | 3523 |
| 3524 This is normally used for things like plugins or helper programs that | 3524 This is normally used for things like plugins or helper programs that |
| 3525 a target needs at runtime. | 3525 a target needs at runtime. |
| 3526 | 3526 |
| 3527 See also "gn help deps" and "gn help data". | 3527 See also "gn help deps" and "gn help data". |
| 3528 | 3528 |
| 3529 ``` | 3529 ``` |
| 3530 | 3530 |
| 3531 ### **Example**: | 3531 ### **Example**: |
| 3532 ``` | 3532 ``` |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3771 | 3771 |
| 3772 These flags are passed on the command-line to the linker and generally | 3772 These flags are passed on the command-line to the linker and generally |
| 3773 specify various linking options. Most targets will not need these and | 3773 specify various linking options. Most targets will not need these and |
| 3774 will use "libs" and "lib_dirs" instead. | 3774 will use "libs" and "lib_dirs" instead. |
| 3775 | 3775 |
| 3776 ldflags are NOT pushed to dependents, so applying ldflags to source | 3776 ldflags are NOT pushed to dependents, so applying ldflags to source |
| 3777 sets or static libraries will be a no-op. If you want to apply ldflags | 3777 sets or static libraries will be a no-op. If you want to apply ldflags |
| 3778 to dependent targets, put them in a config and set it in the | 3778 to dependent targets, put them in a config and set it in the |
| 3779 all_dependent_configs or public_configs. | 3779 all_dependent_configs or public_configs. |
| 3780 | 3780 |
| 3781 ``` | |
| 3782 | |
| 3783 ### **Ordering of flags and values**: | |
|
eroman
2015/09/15 17:57:26
Not sure why this change was added.
I generated t
| |
| 3784 | |
| 3785 ``` | |
| 3786 1. Those set on the current target (not in a config). | |
| 3787 2. Those set on the "configs" on the target in order that the | |
| 3788 configs appear in the list. | |
| 3789 3. Those set on the "all_dependent_configs" on the target in order | |
| 3790 that the configs appear in the list. | |
| 3791 4. Those set on the "public_configs" on the target in order that | |
| 3792 those configs appear in the list. | |
| 3793 5. all_dependent_configs pulled from dependencies, in the order of | |
| 3794 the "deps" list. This is done recursively. If a config appears | |
| 3795 more than once, only the first occurance will be used. | |
| 3796 6. public_configs pulled from dependencies, in the order of the | |
| 3797 "deps" list. If a dependency is public, they will be applied | |
| 3798 recursively. | |
| 3799 | |
| 3781 | 3800 |
| 3782 ``` | 3801 ``` |
| 3783 ## **lib_dirs**: Additional library directories. | 3802 ## **lib_dirs**: Additional library directories. |
| 3784 | 3803 |
| 3785 ``` | 3804 ``` |
| 3786 A list of directories. | 3805 A list of directories. |
| 3787 | 3806 |
| 3788 Specifies additional directories passed to the linker for searching | 3807 Specifies additional directories passed to the linker for searching |
| 3789 for the required libraries. If an item is not an absolute path, it | 3808 for the required libraries. If an item is not an absolute path, it |
| 3790 will be treated as being relative to the current build file. | 3809 will be treated as being relative to the current build file. |
| (...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4824 ** \--nocolor**: Force non-colored output. | 4843 ** \--nocolor**: Force non-colored output. |
| 4825 ** -q**: Quiet mode. Don't print output on success. | 4844 ** -q**: Quiet mode. Don't print output on success. |
| 4826 ** \--root**: Explicitly specify source root. | 4845 ** \--root**: Explicitly specify source root. |
| 4827 ** \--runtime-deps-list-file**: Save runtime dependencies for targets in file. | 4846 ** \--runtime-deps-list-file**: Save runtime dependencies for targets in file. |
| 4828 ** \--time**: Outputs a summary of how long everything took. | 4847 ** \--time**: Outputs a summary of how long everything took. |
| 4829 ** \--tracelog**: Writes a Chrome-compatible trace log to the given file. | 4848 ** \--tracelog**: Writes a Chrome-compatible trace log to the given file. |
| 4830 ** -v**: Verbose logging. | 4849 ** -v**: Verbose logging. |
| 4831 ** \--version**: Prints the GN version number and exits. | 4850 ** \--version**: Prints the GN version number and exits. |
| 4832 | 4851 |
| 4833 ``` | 4852 ``` |
| OLD | NEW |