Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: tools/gn/docs/reference.md

Issue 2387763002: Support for source_target_relative expansion in GN (Closed)
Patch Set: Reimplemented as source_target_relative Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/gn/docs/reference.md
diff --git a/tools/gn/docs/reference.md b/tools/gn/docs/reference.md
index 356712fd399d6230c06bbe42b4c46942d01f3424..65c0cda298b4dbaa85026c8e9d8bde41deea30c7 100644
--- a/tools/gn/docs/reference.md
+++ b/tools/gn/docs/reference.md
@@ -4865,12 +4865,22 @@
the dependencies of the input. Empty or unset means that the script
doesn't generate the files.
+ A depfile should be used only when a target depends on files that are
+ not already specified by a target's inputs and sources. Likewise,
+ depfiles should specify only those dependencies not already included
+ in sources or inputs.
+
The .d file should go in the target output directory. If you have more
than one source file that the script is being run over, you can use
the output file expansions described in "gn help action_foreach" to
name the .d file according to the input.
- The format is that of a Makefile, and all of the paths should be
- relative to the root build directory.
+ The format is that of a Makefile and all paths must be relative to the
+ root build directory. Only one output may be listed and it must match
+ the first output of the action.
+
+ Although depfiles are created by an action, they should not be listed
+ in the action's "outputs" unless another target will use the file as
+ an input.
```
@@ -6461,6 +6471,12 @@
directory than the build.gn file.
"//foo/bar/baz.txt" => "obj/foo/bar"
+ {{source_target_relative}}
+ The path to the source file relative to the target's directory.
+ This will generally be used for replicating the source directory
+ layout in the output directory.
+ "//foo/bar/baz.txt" => "baz.txt"
+
```
### **(*) Note on directories**

Powered by Google App Engine
This is Rietveld 408576698