diff options
author | Brad King <brad.king@kitware.com> | 2020-07-14 11:14:30 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-07-14 11:15:11 (GMT) |
commit | 8c6cce27ca74d28e6370d1a424fc11c1d3686eb9 (patch) | |
tree | 9f33f2423eaf52facffeab25f0ed454e81f2ac65 /Source | |
parent | 2ef6ad0136d2df954fffe6ccce52b1636a0e5771 (diff) | |
parent | d9af90504f7d2a0ac90eeedf12148647b3feb27b (diff) | |
download | CMake-8c6cce27ca74d28e6370d1a424fc11c1d3686eb9.zip CMake-8c6cce27ca74d28e6370d1a424fc11c1d3686eb9.tar.gz CMake-8c6cce27ca74d28e6370d1a424fc11c1d3686eb9.tar.bz2 |
Merge topic 'macos-11-file-GET_RUNTIME_DEPENDENCIES' into release-3.18
d9af90504f Tests: Update file(G_R_D) test to make system library optional
c51400033c file: Update GET_RUNTIME_DEPENDENCIES for macOS 11 dylib cache
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Kyle Edwards <kyle.edwards@kitware.com>
Merge-request: !4998
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmBinUtilsMacOSMachOLinker.cxx | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/Source/cmBinUtilsMacOSMachOLinker.cxx b/Source/cmBinUtilsMacOSMachOLinker.cxx index 98250b1..0f47146 100644 --- a/Source/cmBinUtilsMacOSMachOLinker.cxx +++ b/Source/cmBinUtilsMacOSMachOLinker.cxx @@ -14,6 +14,18 @@ #include "cmStringAlgorithms.h" #include "cmSystemTools.h" +namespace { +bool IsMissingSystemDylib(std::string const& path) +{ + // Starting on macOS 11, the dynamic loader has a builtin cache of + // system-provided dylib files that do not exist on the filesystem. + // Tell our caller that these are expected to be missing. + return ((cmHasLiteralPrefix(path, "/System/Library/") || + cmHasLiteralPrefix(path, "/usr/lib/")) && + !cmSystemTools::PathExists(path)); +} +} + cmBinUtilsMacOSMachOLinker::cmBinUtilsMacOSMachOLinker( cmRuntimeDependencyArchive* archive) : cmBinUtilsLinker(archive) @@ -82,7 +94,8 @@ bool cmBinUtilsMacOSMachOLinker::GetFileDependencies( return false; } if (resolved) { - if (!this->Archive->IsPostExcluded(path)) { + if (!this->Archive->IsPostExcluded(path) && + !IsMissingSystemDylib(path)) { auto filename = cmSystemTools::GetFilenameName(path); bool unique; this->Archive->AddResolvedPath(filename, path, unique); |