diff options
-rw-r--r-- | src/graph.cc | 9 | ||||
-rw-r--r-- | src/graph.h | 1 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/graph.cc b/src/graph.cc index d881280..424f941 100644 --- a/src/graph.cc +++ b/src/graph.cc @@ -177,6 +177,11 @@ string Edge::EvaluateCommand() { return rule_->command_.Evaluate(&env); } +string Edge::EvaluateDepFile() { + EdgeEnv env(this); + return rule_->depfile_.Evaluate(&env); +} + string Edge::GetDescription() { EdgeEnv env(this); return rule_->description_.Evaluate(&env); @@ -184,9 +189,7 @@ string Edge::GetDescription() { bool Edge::LoadDepFile(State* state, DiskInterface* disk_interface, string* err) { - EdgeEnv env(this); - string path = rule_->depfile_.Evaluate(&env); - + string path = EvaluateDepFile(); string content = disk_interface->ReadFile(path, err); if (!err->empty()) return false; diff --git a/src/graph.h b/src/graph.h index 9080dcc..67f7b10 100644 --- a/src/graph.h +++ b/src/graph.h @@ -92,6 +92,7 @@ struct Edge { const string& command, Node* output); string EvaluateCommand(); // XXX move to env, take env ptr + string EvaluateDepFile(); string GetDescription(); bool LoadDepFile(State* state, DiskInterface* disk_interface, string* err); |