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 4668 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4679 | 4679 |
4680 ``` | 4680 ``` |
4681 It may be tempting to write a script that enumerates all files in a | 4681 It may be tempting to write a script that enumerates all files in a |
4682 directory as inputs. Don't do this! Even if you specify all the files | 4682 directory as inputs. Don't do this! Even if you specify all the files |
4683 in the inputs or sources in the GN target (or worse, enumerate the | 4683 in the inputs or sources in the GN target (or worse, enumerate the |
4684 files in an exec_script call when running GN, which will be slow), the | 4684 files in an exec_script call when running GN, which will be slow), the |
4685 dependencies will be broken. | 4685 dependencies will be broken. |
4686 | 4686 |
4687 The problem happens if a file is ever removed because the inputs are | 4687 The problem happens if a file is ever removed because the inputs are |
4688 not listed on the command line to the script. Because the script | 4688 not listed on the command line to the script. Because the script |
4689 hasn't changed and all inputs are up-to-date, the script will not | 4689 hasn't changed and all inputs are up to date, the script will not |
4690 re-run and you will get a stale build. Instead, either list all | 4690 re-run and you will get a stale build. Instead, either list all |
4691 inputs on the command line to the script, or if there are many, create | 4691 inputs on the command line to the script, or if there are many, create |
4692 a separate list file that the script reads. As long as this file is | 4692 a separate list file that the script reads. As long as this file is |
4693 listed in the inputs, the build will detect when it has changed in any | 4693 listed in the inputs, the build will detect when it has changed in any |
4694 way and the action will re-run. | 4694 way and the action will re-run. |
4695 | 4695 |
4696 ``` | 4696 ``` |
4697 | 4697 |
4698 ### **Inputs for binary targets** | 4698 ### **Inputs for binary targets** |
4699 | 4699 |
4700 ``` | 4700 ``` |
4701 Any input dependencies will be resolved before compiling any sources. | 4701 Any input dependencies will be resolved before compiling any sources. |
4702 Normally, all actions that a target depends on will be run before any | 4702 Normally, all actions that a target depends on will be run before any |
4703 files in a target are compiled. So if you depend on generated headers, | 4703 files in a target are compiled. So if you depend on generated headers, |
4704 you do not typically need to list them in the inputs section. | 4704 you do not typically need to list them in the inputs section. |
4705 | 4705 |
4706 Inputs for binary targets will be treated as order-only dependencies, | 4706 Inputs for binary targets will be treated as order-only dependencies, |
4707 meaning that they will be forced up-to-date before compiling or | 4707 meaning that they will be forced up to date before compiling or |
4708 any files in the target, but changes in the inputs will not | 4708 any files in the target, but changes in the inputs will not |
4709 necessarily force the target to compile. This is because it is | 4709 necessarily force the target to compile. This is because it is |
4710 expected that the compiler will report the precise list of input | 4710 expected that the compiler will report the precise list of input |
4711 dependencies required to recompile each file once the initial build | 4711 dependencies required to recompile each file once the initial build |
4712 is done. | 4712 is done. |
4713 | 4713 |
4714 ``` | 4714 ``` |
4715 | 4715 |
4716 ### **Example** | 4716 ### **Example** |
4717 | 4717 |
(...skipping 1383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6101 ** \--root**: Explicitly specify source root. | 6101 ** \--root**: Explicitly specify source root. |
6102 ** \--runtime-deps-list-file**: Save runtime dependencies for targets in file. | 6102 ** \--runtime-deps-list-file**: Save runtime dependencies for targets in file. |
6103 ** \--script-executable**: Set the executable used to execute scripts. | 6103 ** \--script-executable**: Set the executable used to execute scripts. |
6104 ** \--threads**: Specify number of worker threads. | 6104 ** \--threads**: Specify number of worker threads. |
6105 ** \--time**: Outputs a summary of how long everything took. | 6105 ** \--time**: Outputs a summary of how long everything took. |
6106 ** \--tracelog**: Writes a Chrome-compatible trace log to the given file. | 6106 ** \--tracelog**: Writes a Chrome-compatible trace log to the given file. |
6107 ** -v**: Verbose logging. | 6107 ** -v**: Verbose logging. |
6108 ** \--version**: Prints the GN version number and exits. | 6108 ** \--version**: Prints the GN version number and exits. |
6109 | 6109 |
6110 ``` | 6110 ``` |
OLD | NEW |