Skip to content

Instantly share code, notes, and snippets.

@iwadon
Created April 17, 2011 07:54
Show Gist options
  • Select an option

  • Save iwadon/923836 to your computer and use it in GitHub Desktop.

Select an option

Save iwadon/923836 to your computer and use it in GitHub Desktop.
Canonicalize target filename when loading depfiles
diff --git a/src/graph.cc b/src/graph.cc
index a4317ba..bbfb8df 100644
--- a/src/graph.cc
+++ b/src/graph.cc
@@ -148,8 +148,11 @@ bool Edge::LoadDepFile(State* state, DiskInterface* disk_interface,
*err = "expected only one output";
return false;
}
- if (outputs_[0]->file_->path_ != makefile.out_) {
- *err = "expected makefile to mention '" + outputs_[0]->file_->path_ + "', "
+ string output_file_path = outputs_[0]->file_->path_;
+ if (!CanonicalizePath(&output_file_path, err))
+ return false;
+ if (output_file_path != makefile.out_) {
+ *err = "expected makefile to mention '" + output_file_path + "', "
"got '" + makefile.out_ + "'";
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment