Improve error message when a depfile contains a bad path

Debugging "ninja: error: empty path" is not fun, so make the error
message mention the depfile name.
This commit is contained in:
Tomasz Śniatowski 2016-10-12 14:09:28 +02:00
parent 6a2b876d3a
commit 46d9a958fa

View File

@ -422,8 +422,10 @@ bool ImplicitDepLoader::LoadDepFile(Edge* edge, const string& path,
unsigned int unused;
if (!CanonicalizePath(const_cast<char*>(depfile.out_.str_),
&depfile.out_.len_, &unused, err))
&depfile.out_.len_, &unused, err)) {
*err = path + ": " + *err;
return false;
}
// Check that this depfile matches the edge's output, if not return false to
// mark the edge as dirty.