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
@@ -3087,7 +3087,8 @@ std::vector<BT<std::string>> cmGeneratorTarget::GetIncludeDirectories(
cmLinkImplementationLibraries const* impl =
this->GetLinkImplementationLibraries(config);
for (cmLinkImplItem const& lib : impl->Libraries) {
std::string libDir = cmSystemTools::CollapseFullPath(lib.AsStr());
std::string libDir = cmSystemTools::CollapseFullPath(
lib.AsStr(), this->Makefile->GetHomeOutputDirectory());
static cmsys::RegularExpression frameworkCheck(
"(.*\\.framework)(/Versions/[^/]+)?/[^/]+$");