| 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 4847 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4858 | 4858 |
| 4859 ``` | 4859 ``` |
| 4860 ## **depfile**: [string] File name for input dependencies for actions. | 4860 ## **depfile**: [string] File name for input dependencies for actions. |
| 4861 | 4861 |
| 4862 ``` | 4862 ``` |
| 4863 If nonempty, this string specifies that the current action or | 4863 If nonempty, this string specifies that the current action or |
| 4864 action_foreach target will generate the given ".d" file containing | 4864 action_foreach target will generate the given ".d" file containing |
| 4865 the dependencies of the input. Empty or unset means that the script | 4865 the dependencies of the input. Empty or unset means that the script |
| 4866 doesn't generate the files. | 4866 doesn't generate the files. |
| 4867 | 4867 |
| 4868 A depfile should be used only when a target depends on files that are |
| 4869 not already specified by a target's inputs and sources. Likewise, |
| 4870 depfiles should specify only those dependencies not already included |
| 4871 in sources or inputs. |
| 4872 |
| 4868 The .d file should go in the target output directory. If you have more | 4873 The .d file should go in the target output directory. If you have more |
| 4869 than one source file that the script is being run over, you can use | 4874 than one source file that the script is being run over, you can use |
| 4870 the output file expansions described in "gn help action_foreach" to | 4875 the output file expansions described in "gn help action_foreach" to |
| 4871 name the .d file according to the input. | 4876 name the .d file according to the input. |
| 4872 The format is that of a Makefile, and all of the paths should be | 4877 The format is that of a Makefile and all paths must be relative to the |
| 4873 relative to the root build directory. | 4878 root build directory. Only one output may be listed and it must match |
| 4879 the first output of the action. |
| 4880 |
| 4881 Although depfiles are created by an action, they should not be listed |
| 4882 in the action's "outputs" unless another target will use the file as |
| 4883 an input. |
| 4874 | 4884 |
| 4875 ``` | 4885 ``` |
| 4876 | 4886 |
| 4877 ### **Example** | 4887 ### **Example** |
| 4878 | 4888 |
| 4879 ``` | 4889 ``` |
| 4880 action_foreach("myscript_target") { | 4890 action_foreach("myscript_target") { |
| 4881 script = "myscript.py" | 4891 script = "myscript.py" |
| 4882 sources = [ ... ] | 4892 sources = [ ... ] |
| 4883 | 4893 |
| (...skipping 1570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6454 than the BUILD.gn file. | 6464 than the BUILD.gn file. |
| 6455 "//foo/bar/baz.txt" => "gen/foo/bar" | 6465 "//foo/bar/baz.txt" => "gen/foo/bar" |
| 6456 | 6466 |
| 6457 {{source_out_dir}} | 6467 {{source_out_dir}} |
| 6458 The object file directory (*) corresponding to the source file's | 6468 The object file directory (*) corresponding to the source file's |
| 6459 path, relative to the build directory. this us be different than | 6469 path, relative to the build directory. this us be different than |
| 6460 the target's out directory if the source file is in a different | 6470 the target's out directory if the source file is in a different |
| 6461 directory than the build.gn file. | 6471 directory than the build.gn file. |
| 6462 "//foo/bar/baz.txt" => "obj/foo/bar" | 6472 "//foo/bar/baz.txt" => "obj/foo/bar" |
| 6463 | 6473 |
| 6474 {{source_target_relative}} |
| 6475 The path to the source file relative to the target's directory. |
| 6476 This will generally be used for replicating the source directory |
| 6477 layout in the output directory. |
| 6478 "//foo/bar/baz.txt" => "baz.txt" |
| 6479 |
| 6464 ``` | 6480 ``` |
| 6465 | 6481 |
| 6466 ### **(*) Note on directories** | 6482 ### **(*) Note on directories** |
| 6467 | 6483 |
| 6468 ``` | 6484 ``` |
| 6469 Paths containing directories (except the source_root_relative_dir) | 6485 Paths containing directories (except the source_root_relative_dir) |
| 6470 will be different depending on what context the expansion is evaluated | 6486 will be different depending on what context the expansion is evaluated |
| 6471 in. Generally it should "just work" but it means you can't | 6487 in. Generally it should "just work" but it means you can't |
| 6472 concatenate strings containing these values with reasonable results. | 6488 concatenate strings containing these values with reasonable results. |
| 6473 | 6489 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6523 ** \--root**: Explicitly specify source root. | 6539 ** \--root**: Explicitly specify source root. |
| 6524 ** \--runtime-deps-list-file**: Save runtime dependencies for targets in file. | 6540 ** \--runtime-deps-list-file**: Save runtime dependencies for targets in file. |
| 6525 ** \--script-executable**: Set the executable used to execute scripts. | 6541 ** \--script-executable**: Set the executable used to execute scripts. |
| 6526 ** \--threads**: Specify number of worker threads. | 6542 ** \--threads**: Specify number of worker threads. |
| 6527 ** \--time**: Outputs a summary of how long everything took. | 6543 ** \--time**: Outputs a summary of how long everything took. |
| 6528 ** \--tracelog**: Writes a Chrome-compatible trace log to the given file. | 6544 ** \--tracelog**: Writes a Chrome-compatible trace log to the given file. |
| 6529 ** -v**: Verbose logging. | 6545 ** -v**: Verbose logging. |
| 6530 ** \--version**: Prints the GN version number and exits. | 6546 ** \--version**: Prints the GN version number and exits. |
| 6531 | 6547 |
| 6532 ``` | 6548 ``` |
| OLD | NEW |