cmake: avoid getcwd in CollapseFullPath

`CollapseFullPath` calls getcwd, which is a rather expensive system
call. we can replace it with `GetHomeOutputDirectory()` to save us from
the calling overhead
This commit is contained in:
Tim Blechmann
2020-01-14 18:17:50 +08:00
parent 23e782ce05
commit 22f38c0d6b
5 changed files with 10 additions and 5 deletions
+2 -1
View File
@@ -215,7 +215,8 @@ bool cmAddCustomCommandCommand(std::vector<std::string> const& args,
}
if (cmSystemTools::FileIsFullPath(filename)) {
filename = cmSystemTools::CollapseFullPath(filename);
filename = cmSystemTools::CollapseFullPath(
filename, status.GetMakefile().GetHomeOutputDirectory());
}
switch (doing) {
case doing_depfile: