summaryrefslogtreecommitdiffstats
path: root/src/graph.cc
diff options
context:
space:
mode:
authorPeter Collingbourne <peter@pcc.me.uk>2011-11-25 15:18:03 (GMT)
committerPeter Collingbourne <peter@pcc.me.uk>2011-12-06 09:05:15 (GMT)
commit57d8557ff3bfe6772f2dbada1d1ffa5d378ca763 (patch)
tree23bcbd918de2733b0da63b084e51ce1d81afec6d /src/graph.cc
parentf570d499dc7b281eaae3436a5292e55b808d2ed7 (diff)
downloadNinja-57d8557ff3bfe6772f2dbada1d1ffa5d378ca763.zip
Ninja-57d8557ff3bfe6772f2dbada1d1ffa5d378ca763.tar.gz
Ninja-57d8557ff3bfe6772f2dbada1d1ffa5d378ca763.tar.bz2
Factor out Edge::EvaluateDepFile
Diffstat (limited to 'src/graph.cc')
-rw-r--r--src/graph.cc9
1 files changed, 6 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;