summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAtılhan Emre Dursunoğlu <atilhan.dursunoglu@sparsetechnology.com>2023-09-18 11:49:48 (GMT)
committerAtılhan Emre Dursunoğlu <atilhan.dursunoglu@sparsetechnology.com>2023-09-19 14:38:25 (GMT)
commitf173ca21ca2d0e101451f2ffdbe822374ded21ed (patch)
treefc22f5f07d03a4fe7f0bc28fd18fb3b45a8af56c
parent0846414ba26b2a1dc56645722a40317efa826a2b (diff)
downloadCMake-f173ca21ca2d0e101451f2ffdbe822374ded21ed.zip
CMake-f173ca21ca2d0e101451f2ffdbe822374ded21ed.tar.gz
CMake-f173ca21ca2d0e101451f2ffdbe822374ded21ed.tar.bz2
cmBinUtilsLinuxELFLinker: Cache ldconfig results
Running GetLDConfigPaths in every ScanDependencies is expensive.
-rw-r--r--Source/cmBinUtilsLinuxELFLinker.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/Source/cmBinUtilsLinuxELFLinker.cxx b/Source/cmBinUtilsLinuxELFLinker.cxx
index 5972202..e2a8f92 100644
--- a/Source/cmBinUtilsLinuxELFLinker.cxx
+++ b/Source/cmBinUtilsLinuxELFLinker.cxx
@@ -73,6 +73,9 @@ bool cmBinUtilsLinuxELFLinker::Prepare()
if (ldConfigTool == "ldconfig") {
this->LDConfigTool =
cm::make_unique<cmLDConfigLDConfigTool>(this->Archive);
+ if (!this->LDConfigTool->GetLDConfigPaths(this->LDConfigPaths)) {
+ return false;
+ }
} else {
std::ostringstream e;
e << "Invalid value for CMAKE_LDCONFIG_TOOL: " << ldConfigTool;
@@ -132,12 +135,8 @@ bool cmBinUtilsLinuxELFLinker::ScanDependencies(
parentRpaths.end());
}
- std::vector<std::string> ldConfigPaths;
- if (!this->LDConfigTool->GetLDConfigPaths(ldConfigPaths)) {
- return false;
- }
- searchPaths.insert(searchPaths.end(), ldConfigPaths.begin(),
- ldConfigPaths.end());
+ searchPaths.insert(searchPaths.end(), this->LDConfigPaths.begin(),
+ this->LDConfigPaths.end());
for (auto const& dep : needed) {
if (!this->Archive->IsPreExcluded(dep)) {