summaryrefslogtreecommitdiffstats
path: root/src/ninja.cc
diff options
context:
space:
mode:
authorScott Graham <scottmg@chromium.org>2012-04-13 23:55:37 (GMT)
committerScott Graham <scottmg@chromium.org>2012-04-13 23:55:37 (GMT)
commit1aae1bc765acf6a21b2fcb088f44bba8f3badec7 (patch)
tree1b6097fa397d37bb8d5725f203dcc4df9e31d866 /src/ninja.cc
parent16cab01cccf0b3ccadb150cd54f760929b3cc07e (diff)
downloadNinja-1aae1bc765acf6a21b2fcb088f44bba8f3badec7.zip
Ninja-1aae1bc765acf6a21b2fcb088f44bba8f3badec7.tar.gz
Ninja-1aae1bc765acf6a21b2fcb088f44bba8f3badec7.tar.bz2
add support for -d explain to help debug why rules are running
Diffstat (limited to 'src/ninja.cc')
-rw-r--r--src/ninja.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ninja.cc b/src/ninja.cc
index 7d020db..c2426c4 100644
--- a/src/ninja.cc
+++ b/src/ninja.cc
@@ -39,6 +39,7 @@
#include "build_log.h"
#include "clean.h"
#include "edit_distance.h"
+#include "explain.h"
#include "graph.h"
#include "graphviz.h"
#include "metrics.h"
@@ -567,12 +568,16 @@ int RunTool(const string& tool, Globals* globals, int argc, char** argv) {
bool DebugEnable(const string& name, Globals* globals) {
if (name == "list") {
printf("debugging modes:\n"
-" stats print operation counts/timing info\n");
-//"multiple modes can be enabled via -d FOO -d BAR\n");
+" stats print operation counts/timing info\n"
+" explain explain what caused a command to execute\n"
+"multiple modes can be enabled via -d FOO -d BAR\n");
return false;
} else if (name == "stats") {
g_metrics = new Metrics;
return true;
+ } else if (name == "explain") {
+ g_explaining = true;
+ return true;
} else {
printf("ninja: unknown debug setting '%s'\n", name.c_str());
return false;