summaryrefslogtreecommitdiff
path: root/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx
diff options
context:
space:
mode:
authorBianca van Schaik <bvschaik@gmail.com>2021-01-15 10:20:21 +0100
committerBrad King <brad.king@kitware.com>2021-01-20 10:26:54 -0500
commit7e615a540ea346716ba3d94b4bcecb35c42d5107 (patch)
treec79c9b74e3859d724f3e7cbf738a7a242b0b6e54 /Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx
parentf2d92b983b8d46f54f4de050d5a10d59ba3ebec0 (diff)
downloadcmake-7e615a540ea346716ba3d94b4bcecb35c42d5107.tar.gz
file(GET_RUNTIME_DEPENDENCIES): Fix weak macOS libraries not detected
Starting with Clang 12, `otool -l` reports `LC_LOAD_WEAK_DYLIB` instead of `LC_LOAD_DYLIB` for weakly linked libraries. Update the implementation of `file(GET_RUNTIME_DEPENDENCIES)` to recognize these. Fixes: #21684
Diffstat (limited to 'Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx')
-rw-r--r--Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx b/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx
index 351d92aa82..6d97720c25 100644
--- a/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx
+++ b/Source/cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool.cxx
@@ -44,7 +44,7 @@ bool cmBinUtilsMacOSMachOOToolGetRuntimeDependenciesTool::GetFileInfo(
std::string line;
static const cmsys::RegularExpression rpathRegex("^ *cmd LC_RPATH$");
static const cmsys::RegularExpression loadDylibRegex(
- "^ *cmd LC_LOAD_DYLIB$");
+ "^ *cmd LC_LOAD(_WEAK)?_DYLIB$");
static const cmsys::RegularExpression pathRegex(
"^ *path (.*) \\(offset [0-9]+\\)$");
static const cmsys::RegularExpression nameRegex(