diff options
Diffstat (limited to 'src/build.h')
-rw-r--r-- | src/build.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/build.h b/src/build.h index 0f7303e..fa0abd2 100644 --- a/src/build.h +++ b/src/build.h @@ -15,6 +15,7 @@ #ifndef NINJA_BUILD_H_ #define NINJA_BUILD_H_ +#include <map> #include <set> #include <string> #include <queue> @@ -41,7 +42,7 @@ struct Plan { Edge* FindWork(); /// Returns true if there's more work to be done. - bool more_to_do() const { return !want_.empty(); } + bool more_to_do() const { return wanted_edges_; } /// Dumps the current state of the plan. void Dump(); @@ -58,11 +59,20 @@ private: bool CheckDependencyCycle(Node* node, vector<Node*>* stack, string* err); void NodeFinished(Node* node); - set<Edge*> want_; + /// Keep track of which edges we want to build in this plan. If this map does + /// not contain an entry for an edge, we do not want to build the entry or its + /// dependents. If an entry maps to false, we do not want to build it, but we + /// might want to build one of its dependents. If the entry maps to true, we + /// want to build it. + map<Edge*, bool> want_; + set<Edge*> ready_; /// Total number of edges that have commands (not phony). int command_edges_; + + /// Total remaining number of wanted edges. + int wanted_edges_; }; /// CommandRunner is an interface that wraps running the build |