diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-05-13 14:32:08 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2020-05-13 15:12:54 +0000 |
commit | 46fb39ef5ab5dff2d442ac382f0790afd265dc9d (patch) | |
tree | 233143435bffe325a16a92a0cb4e11ac03a8a65a /src/corelib/global/qlibraryinfo.cpp | |
parent | 92df790f46b3a8b17aec2f385d6472fd3f8647f6 (diff) |
Fix crash on macOS with -qtlibinfix'ed Qt
When Qt is configured with -qtlibinfix Foo then the prefix determination code
in QLibraryInfo crashed, because it still assumed the library name to be
"QtCore".
Fixes: QTBUG-83912
Pick-to: 5.15
Change-Id: I104e115ac6904fc0a04ac45d68d26d4e02aba721
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Diffstat (limited to 'src/corelib/global/qlibraryinfo.cpp')
-rw-r--r-- | src/corelib/global/qlibraryinfo.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp index 82c255348f..871b2071fd 100644 --- a/src/corelib/global/qlibraryinfo.cpp +++ b/src/corelib/global/qlibraryinfo.cpp @@ -534,7 +534,10 @@ static QString getRelocatablePrefix() #if defined(QT_STATIC) prefixPath = prefixFromAppDirHelper(); #elif defined(Q_OS_DARWIN) && QT_CONFIG(framework) - auto qtCoreBundle = CFBundleGetBundleWithIdentifier(CFSTR("org.qt-project.QtCore")); +#ifndef QT_LIBINFIX + #define QT_LIBINFIX "" +#endif + auto qtCoreBundle = CFBundleGetBundleWithIdentifier(CFSTR("org.qt-project.QtCore" QT_LIBINFIX)); if (!qtCoreBundle) { // When running Qt apps over Samba shares, CoreFoundation will fail to find // the Resources directory inside the bundle, This directory is a symlink, @@ -547,7 +550,7 @@ static QString getRelocatablePrefix() auto bundle = CFBundleRef(CFArrayGetValueAtIndex(allBundles, i)); auto url = QCFType<CFURLRef>(CFBundleCopyBundleURL(bundle)); auto path = QCFType<CFStringRef>(CFURLCopyFileSystemPath(url, kCFURLPOSIXPathStyle)); - if (CFStringHasSuffix(path, CFSTR("/QtCore.framework"))) { + if (CFStringHasSuffix(path, CFSTR("/QtCore" QT_LIBINFIX ".framework"))) { qtCoreBundle = bundle; break; } |