summaryrefslogtreecommitdiff
path: root/Source/cmBinUtilsMacOSMachOLinker.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmBinUtilsMacOSMachOLinker.cxx')
-rw-r--r--Source/cmBinUtilsMacOSMachOLinker.cxx22
1 files changed, 14 insertions, 8 deletions
diff --git a/Source/cmBinUtilsMacOSMachOLinker.cxx b/Source/cmBinUtilsMacOSMachOLinker.cxx
index 0f47146c5..47f77d8b9 100644
--- a/Source/cmBinUtilsMacOSMachOLinker.cxx
+++ b/Source/cmBinUtilsMacOSMachOLinker.cxx
@@ -65,18 +65,18 @@ bool cmBinUtilsMacOSMachOLinker::ScanDependencies(
if (!executableFile.empty()) {
executablePath = cmSystemTools::GetFilenamePath(executableFile);
}
- return this->ScanDependencies(file, executablePath);
-}
-
-bool cmBinUtilsMacOSMachOLinker::ScanDependencies(
- std::string const& file, std::string const& executablePath)
-{
std::vector<std::string> libs;
std::vector<std::string> rpaths;
if (!this->Tool->GetFileInfo(file, libs, rpaths)) {
return false;
}
+ return this->ScanDependencies(file, libs, rpaths, executablePath);
+}
+bool cmBinUtilsMacOSMachOLinker::ScanDependencies(
+ std::string const& file, std::vector<std::string> const& libs,
+ std::vector<std::string> const& rpaths, std::string const& executablePath)
+{
std::string loaderPath = cmSystemTools::GetFilenamePath(file);
return this->GetFileDependencies(libs, executablePath, loaderPath, rpaths);
}
@@ -98,8 +98,14 @@ bool cmBinUtilsMacOSMachOLinker::GetFileDependencies(
!IsMissingSystemDylib(path)) {
auto filename = cmSystemTools::GetFilenameName(path);
bool unique;
- this->Archive->AddResolvedPath(filename, path, unique);
- if (unique && !this->ScanDependencies(path, executablePath)) {
+ std::vector<std::string> libs;
+ std::vector<std::string> depRpaths;
+ if (!this->Tool->GetFileInfo(path, libs, depRpaths)) {
+ return false;
+ }
+ this->Archive->AddResolvedPath(filename, path, unique, depRpaths);
+ if (unique &&
+ !this->ScanDependencies(path, libs, depRpaths, executablePath)) {
return false;
}
}