32 return LoadDyndeps(node, &ddf, err);
36 std::string* err)
const {
41 explanations_.Record(node,
"loading dyndep file '%s'", node->
path().c_str());
43 if (!LoadDyndepFile(node, ddf, err))
47 std::vector<Edge*>
const& out_edges = node->
out_edges();
48 for (
Edge* edge : out_edges) {
49 if (edge->dyndep_ != node)
52 DyndepFile::iterator ddi = ddf->find(edge);
53 if (ddi == ddf->end()) {
54 *err = (
"'" + edge->outputs_[0]->path() +
"' "
55 "not mentioned in its dyndep file "
56 "'" + node->
path() +
"'");
60 ddi->second.used_ =
true;
61 Dyndeps const& dyndeps = ddi->second;
62 if (!UpdateEdge(edge, &dyndeps, err)) {
68 for (
const auto& dyndep_output : *ddf) {
69 if (!dyndep_output.second.used_) {
70 Edge*
const edge = dyndep_output.first;
71 *err = (
"dyndep file '" + node->
path() +
"' mentions output "
72 "'" + edge->
outputs_[0]->path() +
"' whose build statement "
73 "does not have a dyndep binding for the file");
82 std::string* err)
const {
99 *err =
"multiple rules generate " + node->
path();
119 std::string* err)
const {
121 return parser.
Load(file->
path(), err);
void AddBinding(const std::string &key, const std::string &val)
Store data loaded from one dyndep file.
bool LoadDyndepFile(Node *file, DyndepFile *ddf, std::string *err) const
bool UpdateEdge(Edge *edge, Dyndeps const *dyndeps, std::string *err) const
bool LoadDyndeps(Node *node, std::string *err) const
Load a dyndep file from the given node's path and update the build graph with the new information.
Store dynamically-discovered dependency information for one edge.
std::vector< Node * > implicit_inputs_
std::vector< Node * > implicit_outputs_
An edge in the dependency graph; links between Nodes using Rules.
std::vector< Node * > outputs_
std::vector< Node * > inputs_
Information about a node in the dependency graph: the file, whether it's dirty, mtime,...
void set_in_edge(Edge *edge)
void set_dyndep_pending(bool pending)
void AddOutEdge(Edge *edge)
const std::string & path() const
const std::vector< Edge * > & out_edges() const
bool Load(const std::string &filename, std::string *err, Lexer *parent=NULL)
Load and parse a file.