summaryrefslogtreecommitdiffstats
path: root/src/corelib/plugin
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2017-02-14 11:33:02 +0100
committerLiang Qi <liang.qi@qt.io>2017-02-14 11:33:02 +0100
commit27432d40f2500b11780398f6c7d67719050dae6c (patch)
tree97f9a60af2d520d66fa7ff802ccddad56e0cadaf /src/corelib/plugin
parent071a120400b17eaa0b414a0ed262b0a090908679 (diff)
parent10ecbc4041cb7db004f4ed4d40ce082553d75844 (diff)
Merge remote-tracking branch 'origin/5.8' into 5.9
Diffstat (limited to 'src/corelib/plugin')
-rw-r--r--src/corelib/plugin/qlibrary.cpp34
1 files changed, 13 insertions, 21 deletions
diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp
index aff2991ed1..96cf5371f9 100644
--- a/src/corelib/plugin/qlibrary.cpp
+++ b/src/corelib/plugin/qlibrary.cpp
@@ -617,40 +617,34 @@ bool QLibrary::isLibrary(const QString &fileName)
{
#if defined(Q_OS_WIN)
return fileName.endsWith(QLatin1String(".dll"), Qt::CaseInsensitive);
-#else
+#else // Generic Unix
QString completeSuffix = QFileInfo(fileName).completeSuffix();
if (completeSuffix.isEmpty())
return false;
const QVector<QStringRef> suffixes = completeSuffix.splitRef(QLatin1Char('.'));
-# if defined(Q_OS_DARWIN)
-
- // On Mac, libs look like libmylib.1.0.0.dylib
- const QStringRef &lastSuffix = suffixes.at(suffixes.count() - 1);
- const QStringRef &firstSuffix = suffixes.at(0);
-
- bool valid = (lastSuffix == QLatin1String("dylib")
- || firstSuffix == QLatin1String("so")
- || firstSuffix == QLatin1String("bundle"));
-
- return valid;
-# else // Generic Unix
QStringList validSuffixList;
-# if defined(Q_OS_HPUX)
+# if defined(Q_OS_HPUX)
/*
See "HP-UX Linker and Libraries User's Guide", section "Link-time Differences between PA-RISC and IPF":
"In PA-RISC (PA-32 and PA-64) shared libraries are suffixed with .sl. In IPF (32-bit and 64-bit),
the shared libraries are suffixed with .so. For compatibility, the IPF linker also supports the .sl suffix."
*/
validSuffixList << QLatin1String("sl");
-# if defined __ia64
+# if defined __ia64
validSuffixList << QLatin1String("so");
-# endif
-# elif defined(Q_OS_AIX)
+# endif
+# elif defined(Q_OS_AIX)
validSuffixList << QLatin1String("a") << QLatin1String("so");
-# elif defined(Q_OS_UNIX)
+# elif defined(Q_OS_DARWIN)
+ // On Apple platforms, dylib look like libmylib.1.0.0.dylib
+ if (suffixes.last() == QLatin1String("dylib"))
+ return true;
+
+ validSuffixList << QLatin1String("so") << QLatin1String("bundle");
+# elif defined(Q_OS_UNIX)
validSuffixList << QLatin1String("so");
-# endif
+# endif
// Examples of valid library names:
// libfoo.so
@@ -669,9 +663,7 @@ bool QLibrary::isLibrary(const QString &fileName)
if (i != suffixPos)
suffixes.at(i).toInt(&valid);
return valid;
-# endif
#endif
-
}
typedef const char * (*QtPluginQueryVerificationDataFunction)();