diff options
Diffstat (limited to 'src/build.h')
-rw-r--r-- | src/build.h | 33 |
1 files changed, 29 insertions, 4 deletions
diff --git a/src/build.h b/src/build.h index a42b8d4..ab59f0c 100644 --- a/src/build.h +++ b/src/build.h @@ -32,6 +32,7 @@ struct BuildLog; struct BuildStatus; +struct Builder; struct DiskInterface; struct Edge; struct Node; @@ -40,7 +41,7 @@ struct State; /// Plan stores the state of a build plan: what we intend to build, /// which steps we're ready to execute. struct Plan { - Plan(); + Plan(Builder* builder = NULL); /// Add a target to our plan (including all its dependencies). /// Returns false if we don't need to build this target; may @@ -63,7 +64,10 @@ struct Plan { }; /// Mark an edge as done building (whether it succeeded or failed). - void EdgeFinished(Edge* edge, EdgeResult result); + /// If any of the edge's outputs are dyndep bindings of their dependents, + /// this loads dynamic dependencies from the nodes' paths. + /// Returns 'false' if loading dyndep info fails and 'true' otherwise. + bool EdgeFinished(Edge* edge, EdgeResult result, string* err); /// Clean the given node during the build. /// Return false on error. @@ -75,9 +79,21 @@ struct Plan { /// Reset state. Clears want and ready sets. void Reset(); + /// Update the build plan to account for modifications made to the graph + /// by information loaded from a dyndep file. + bool DyndepsLoaded(DependencyScan* scan, Node* node, + const DyndepFile& ddf, string* err); private: - bool AddSubTarget(Node* node, Node* dependent, string* err); - void NodeFinished(Node* node); + bool RefreshDyndepDependents(DependencyScan* scan, Node* node, string* err); + void UnmarkDependents(Node* node, set<Node*>* dependents); + bool AddSubTarget(Node* node, Node* dependent, string* err, + set<Edge*>* dyndep_walk); + + /// Update plan with knowledge that the given node is up to date. + /// If the node is a dyndep binding on any of its dependents, this + /// loads dynamic dependencies from the node's path. + /// Returns 'false' if loading dyndep info fails and 'true' otherwise. + bool NodeFinished(Node* node, string* err); /// Enumerate possible steps we want for an edge. enum Want @@ -92,6 +108,9 @@ private: kWantToFinish }; + void EdgeWanted(Edge* edge); + bool EdgeMaybeReady(map<Edge*, Want>::iterator want_e, string* err); + /// Submits a ready edge as a candidate for execution. /// The edge may be delayed from running, for example if it's a member of a /// currently-full pool. @@ -105,6 +124,8 @@ private: set<Edge*> ready_; + Builder* builder_; + /// Total number of edges that have commands (not phony). int command_edges_; @@ -189,6 +210,9 @@ struct Builder { scan_.set_build_log(log); } + /// Load the dyndep information provided by the given node. + bool LoadDyndeps(Node* node, string* err); + State* state_; const BuildConfig& config_; Plan plan_; @@ -219,6 +243,7 @@ struct BuildStatus { void BuildEdgeStarted(Edge* edge); void BuildEdgeFinished(Edge* edge, bool success, const string& output, int* start_time, int* end_time); + void BuildLoadDyndeps(); void BuildStarted(); void BuildFinished(); |