mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-30 18:29:37 -06:00
cmBinUtilsLinuxELFLinker: Cache ldconfig results
Running GetLDConfigPaths in every ScanDependencies is expensive.
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user