summaryrefslogtreecommitdiff
path: root/Source/cmAddCustomCommandCommand.cxx
diff options
context:
space:
mode:
authorTim Blechmann <tim@klingt.org>2020-01-14 18:17:50 +0800
committerTim Blechmann <tim@klingt.org>2020-01-14 18:20:39 +0800
commit22f38c0d6b482e99bb793f64c7701259dcf00bd7 (patch)
tree9c920e53c23ad1559c345c1705475619bf7cb7b4 /Source/cmAddCustomCommandCommand.cxx
parent23e782ce05b5996536eff4c075d4bc36a8d8ba85 (diff)
downloadcmake-22f38c0d6b482e99bb793f64c7701259dcf00bd7.tar.gz
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
Diffstat (limited to 'Source/cmAddCustomCommandCommand.cxx')
-rw-r--r--Source/cmAddCustomCommandCommand.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmAddCustomCommandCommand.cxx b/Source/cmAddCustomCommandCommand.cxx
index 995088c55c..5deba8b5a7 100644
--- a/Source/cmAddCustomCommandCommand.cxx
+++ b/Source/cmAddCustomCommandCommand.cxx
@@ -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: