summaryrefslogtreecommitdiffstats
path: root/src/ninja.cc
diff options
context:
space:
mode:
authorShinichiro Hamaji <shinichiro.hamaji@gmail.com>2016-01-28 09:16:07 (GMT)
committerShinichiro Hamaji <shinichiro.hamaji@gmail.com>2016-01-28 09:22:12 (GMT)
commit24750de7d7ec1a74830410ffdb53ca1f22efdc26 (patch)
tree0b9c466f4ebdfa7dc6863cb88d9337e3a6897b3a /src/ninja.cc
parent233acbad4dea6410b567f077ecc8699525a46683 (diff)
downloadNinja-24750de7d7ec1a74830410ffdb53ca1f22efdc26.zip
Ninja-24750de7d7ec1a74830410ffdb53ca1f22efdc26.tar.gz
Ninja-24750de7d7ec1a74830410ffdb53ca1f22efdc26.tar.bz2
Add -d keepdepfile to preserve depfiles
This is useful when you are developing a tool which generates GCC-style depfiles.
Diffstat (limited to 'src/ninja.cc')
-rw-r--r--src/ninja.cc15
1 files changed, 10 insertions, 5 deletions
diff --git a/src/ninja.cc b/src/ninja.cc
index 691afad..bb76f5d 100644
--- a/src/ninja.cc
+++ b/src/ninja.cc
@@ -774,9 +774,10 @@ const Tool* ChooseTool(const string& tool_name) {
bool DebugEnable(const string& name) {
if (name == "list") {
printf("debugging modes:\n"
-" stats print operation counts/timing info\n"
-" explain explain what caused a command to execute\n"
-" keeprsp don't delete @response files on success\n"
+" stats print operation counts/timing info\n"
+" explain explain what caused a command to execute\n"
+" keepdepfile don't delete depfiles after they're read by ninja\n"
+" keeprsp don't delete @response files on success\n"
#ifdef _WIN32
" nostatcache don't batch stat() calls per directory and cache them\n"
#endif
@@ -788,6 +789,9 @@ bool DebugEnable(const string& name) {
} else if (name == "explain") {
g_explaining = true;
return true;
+ } else if (name == "keepdepfile") {
+ g_keep_depfile = true;
+ return true;
} else if (name == "keeprsp") {
g_keep_rsp = true;
return true;
@@ -796,8 +800,9 @@ bool DebugEnable(const string& name) {
return true;
} else {
const char* suggestion =
- SpellcheckString(name.c_str(), "stats", "explain", "keeprsp",
- "nostatcache", NULL);
+ SpellcheckString(name.c_str(),
+ "stats", "explain", "keepdepfile", "keeprsp",
+ "nostatcache", NULL);
if (suggestion) {
Error("unknown debug setting '%s', did you mean '%s'?",
name.c_str(), suggestion);