summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/graphviz.cc8
-rw-r--r--src/graphviz.h7
-rw-r--r--src/ninja.cc2
3 files changed, 16 insertions, 1 deletions
diff --git a/src/graphviz.cc b/src/graphviz.cc
index dce8b32..0d07251 100644
--- a/src/graphviz.cc
+++ b/src/graphviz.cc
@@ -17,6 +17,7 @@
#include <stdio.h>
#include <algorithm>
+#include "dyndep.h"
#include "graph.h"
void GraphViz::AddTarget(Node* node) {
@@ -40,6 +41,13 @@ void GraphViz::AddTarget(Node* node) {
return;
visited_edges_.insert(edge);
+ if (edge->dyndep_ && edge->dyndep_->dyndep_pending()) {
+ std::string err;
+ if (!dyndep_loader_.LoadDyndeps(edge->dyndep_, &err)) {
+ Warning("%s\n", err.c_str());
+ }
+ }
+
if (edge->inputs_.size() == 1 && edge->outputs_.size() == 1) {
// Can draw simply.
// Note extra space before label text -- this is cosmetic and feels
diff --git a/src/graphviz.h b/src/graphviz.h
index 408496d..601c9b2 100644
--- a/src/graphviz.h
+++ b/src/graphviz.h
@@ -17,15 +17,22 @@
#include <set>
+#include "dyndep.h"
+
+struct DiskInterface;
struct Node;
struct Edge;
+struct State;
/// Runs the process of creating GraphViz .dot file output.
struct GraphViz {
+ GraphViz(State* state, DiskInterface* disk_interface)
+ : dyndep_loader_(state, disk_interface) {}
void Start();
void AddTarget(Node* node);
void Finish();
+ DyndepLoader dyndep_loader_;
std::set<Node*> visited_nodes_;
std::set<Edge*> visited_edges_;
};
diff --git a/src/ninja.cc b/src/ninja.cc
index 8580e4f..4a176c1 100644
--- a/src/ninja.cc
+++ b/src/ninja.cc
@@ -338,7 +338,7 @@ int NinjaMain::ToolGraph(const Options* options, int argc, char* argv[]) {
return 1;
}
- GraphViz graph;
+ GraphViz graph(&state_, &disk_interface_);
graph.Start();
for (vector<Node*>::const_iterator n = nodes.begin(); n != nodes.end(); ++n)
graph.AddTarget(*n);