summaryrefslogtreecommitdiff
path: root/src/dyndep.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/dyndep.h')
-rw-r--r--src/dyndep.h28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/dyndep.h b/src/dyndep.h
index 80c5d1b..907f921 100644
--- a/src/dyndep.h
+++ b/src/dyndep.h
@@ -16,14 +16,18 @@
#define NINJA_DYNDEP_LOADER_H_
#include <map>
+#include <string>
#include <vector>
+struct DiskInterface;
struct Edge;
struct Node;
+struct State;
/// Store dynamically-discovered dependency information for one edge.
struct Dyndeps {
- Dyndeps() : restat_(false) {}
+ Dyndeps() : used_(false), restat_(false) {}
+ bool used_;
bool restat_;
std::vector<Node*> implicit_inputs_;
std::vector<Node*> implicit_outputs_;
@@ -35,4 +39,26 @@ struct Dyndeps {
/// forward-declare it in other headers.
struct DyndepFile: public std::map<Edge*, Dyndeps> {};
+/// DyndepLoader loads dynamically discovered dependencies, as
+/// referenced via the "dyndep" attribute in build files.
+struct DyndepLoader {
+ DyndepLoader(State* state, DiskInterface* disk_interface)
+ : state_(state), disk_interface_(disk_interface) {}
+
+ /// Load a dyndep file from the given node's path and update the
+ /// build graph with the new information. One overload accepts
+ /// a caller-owned 'DyndepFile' object in which to store the
+ /// information loaded from the dyndep file.
+ bool LoadDyndeps(Node* node, std::string* err) const;
+ bool LoadDyndeps(Node* node, DyndepFile* ddf, std::string* err) const;
+
+ private:
+ bool LoadDyndepFile(Node* file, DyndepFile* ddf, std::string* err) const;
+
+ bool UpdateEdge(Edge* edge, Dyndeps const* dyndeps, std::string* err) const;
+
+ State* state_;
+ DiskInterface* disk_interface_;
+};
+
#endif // NINJA_DYNDEP_LOADER_H_