summaryrefslogtreecommitdiffstats
path: root/src/build.h
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2015-12-02 14:52:18 (GMT)
committerBrad King <brad.king@kitware.com>2019-04-18 12:21:44 (GMT)
commit2375707bdfc83c79c94cac93a957de71c294737c (patch)
tree9ccac1cec095db3401a6d467d8a2bbea0f43edba /src/build.h
parent0f0fb3275d0c908d9a4401c97cd5ef9d407987d4 (diff)
downloadNinja-2375707bdfc83c79c94cac93a957de71c294737c.zip
Ninja-2375707bdfc83c79c94cac93a957de71c294737c.tar.gz
Ninja-2375707bdfc83c79c94cac93a957de71c294737c.tar.bz2
Teach builder to load dyndep files when they are ready
After finishing an edge that produces a dyndep file, load the file and update the build graph structure. Recompute the dirty state of all its dependents and of newly reachable portions of the graph. Add edges to the build plan that are discovered to be wanted. Finally, schedule edges that are wanted and now ready to build.
Diffstat (limited to 'src/build.h')
-rw-r--r--src/build.h21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/build.h b/src/build.h
index 1b596b3..ab59f0c 100644
--- a/src/build.h
+++ b/src/build.h
@@ -64,7 +64,9 @@ struct Plan {
};
/// Mark an edge as done building (whether it succeeded or failed).
- /// Returns 'true'.
+ /// 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.
@@ -77,11 +79,20 @@ 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);
+ 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.
- /// Returns 'true'.
+ /// 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.
@@ -199,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_;
@@ -229,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();