diff options
Diffstat (limited to 'Source/cmBinUtilsMacOSMachOLinker.cxx')
-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); |