summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@qt.io>2019-11-28 13:38:28 +0100
committerJoerg Bornemann <joerg.bornemann@qt.io>2019-11-28 13:48:00 +0100
commitc33916a279ef5908e1ebd44644c873933f6a7c77 (patch)
tree6b3384b5dccc528f0c926e293ef39fc68a4cc5c7
parenta131d6100ca13b00721ea30e6ef0d5225002867e (diff)
downloadqtbase-c33916a279ef5908e1ebd44644c873933f6a7c77.tar.gz
Fix prefix determination for windeployqt'ed MinGW applications
We hard-coded the assumption the import lib naming scheme is always basename + ".lib" which is wrong for MinGW. This amends commit a131d610. Fixes: QTBUG-80366 Change-Id: Ibefb8a54483cc62743b8783530644b03e720262c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r--src/corelib/global/qlibraryinfo.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/corelib/global/qlibraryinfo.cpp b/src/corelib/global/qlibraryinfo.cpp
index 8c3ed184ae..f0f77fe68e 100644
--- a/src/corelib/global/qlibraryinfo.cpp
+++ b/src/corelib/global/qlibraryinfo.cpp
@@ -574,11 +574,19 @@ static QString getRelocatablePrefix()
const QString libdir = QString::fromLatin1(
qt_configure_strs + qt_configure_str_offsets[QLibraryInfo::LibrariesPath - 1]);
const QLatin1Char slash('/');
- const QString qtCoreImpLibPath
- = qtCoreDirPath
+#if defined(Q_CC_MINGW)
+ const QString implibPrefix = QStringLiteral("lib");
+ const QString implibSuffix = QStringLiteral(".a");
+#else
+ const QString implibPrefix;
+ const QString implibSuffix = QStringLiteral(".lib");
+#endif
+ const QString qtCoreImpLibFileName = implibPrefix
+ + QFileInfo(qtCoreFilePath).completeBaseName() + implibSuffix;
+ const QString qtCoreImpLibPath = qtCoreDirPath
+ slash + QLatin1String(QT_CONFIGURE_LIBLOCATION_TO_PREFIX_PATH)
+ slash + libdir
- + slash + QFileInfo(qtCoreFilePath).completeBaseName() + QLatin1String(".lib");
+ + slash + qtCoreImpLibFileName;
if (!QFileInfo::exists(qtCoreImpLibPath)) {
// We did not find a corresponding import library and conclude that this is a
// windeployqt'ed executable.