summaryrefslogtreecommitdiffstats
path: root/src/corelib/global
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2020-05-13 14:32:08 +0200
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2020-05-19 22:20:10 +0200
commitf725796bd0a069f9024cc958bdb83901a24db391 (patch)
tree596a4ddf3edecd1f277feeff22603a12a6a12fa5 /src/corelib/global
parent8a3440df42f39814050cf8b11d4eee103af8f41a (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 Change-Id: I104e115ac6904fc0a04ac45d68d26d4e02aba721 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> (cherry picked from commit 46fb39ef5ab5dff2d442ac382f0790afd265dc9d) Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/corelib/global')
-rw-r--r--src/corelib/global/qlibraryinfo.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index f1d7832e46..df9ef77fb2 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -535,7 +535,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,
@@ -548,7 +551,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;
}