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

Unified Diff: tools/gn/variables.cc

Issue 55633002: GN: Add ability to specify a depfile for custom targets. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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
« tools/gn/value_extractors.h ('K') | « tools/gn/variables.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/variables.cc
diff --git a/tools/gn/variables.cc b/tools/gn/variables.cc
index ea40adef20236e4bdcc574a3c6390cce37d6ee6c..da02b3431ef6270e6d495473c80efafd85135bd0 100644
--- a/tools/gn/variables.cc
+++ b/tools/gn/variables.cc
@@ -393,6 +393,37 @@ const char kDefines_Help[] =
"Example:\n"
" defines = [ \"AWESOME_FEATURE\", \"LOG_LEVEL=3\" ]\n";
+const char kDepfile[] = "depfile";
+const char kDepfile_HelpShort[] =
+ "depfile: [string] File name for input dependencies for custom targets.";
+const char kDepfile_Help[] =
+ "depfile: [string] File name for input dependencies for custom targets.\n"
brettw 2013/11/04 05:22:14 I've been putting a blank line after this in the o
koz (OOO until 15th September) 2013/11/06 07:29:11 Done.
+ " If nonempty, this string specifies that the current \"custom\" target\n"
+ " will generate the given \".d\" file containing the dependencies of the\n"
+ " input. Empty or unset means that the script doesn't generate the\n"
+ " files.\n"
+ "\n"
+ " The .d file should go in the target output directory. If you have more\n"
+ " than one source file that the script is being run over, you can use\n"
+ " the output file expansions described in \"gn help custom\" to name the\n"
+ " .d file according to the input."
+ "\n"
+ " The format is that of a Makefile, and all of the paths should be\n"
+ " relative to the root build directory.\n"
+ "\n"
+ "Example:\n"
+ " custom(\"myscript_target\") {\n"
+ " script = \"myscript.py\"\n"
+ " sources = [ ... ]\n"
+ "\n"
+ " # Locate the deps file in the output directory named like the\n"
+ " # inputs but with a \".d\" appended.\n"
+ " depfile = \"$relative_target_output_dir/{{source_name}}.d\"\n"
+ "\n"
+ " # Say our script uses \"-o <d file>\" to indicate the deps file.\n"
+ " args = [ \"{{source}}\", \"-o\", depfile ]\n"
+ " }\n";
+
const char kDeps[] = "deps";
const char kDeps_HelpShort[] =
"deps: [label list] Linked dependencies.";
@@ -767,6 +798,7 @@ const VariableInfoMap& GetTargetVariables() {
INSERT_VARIABLE(Configs)
INSERT_VARIABLE(Data)
INSERT_VARIABLE(Datadeps)
+ INSERT_VARIABLE(Depfile)
INSERT_VARIABLE(Deps)
INSERT_VARIABLE(DirectDependentConfigs)
INSERT_VARIABLE(External)
« tools/gn/value_extractors.h ('K') | « tools/gn/variables.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698