diff options
Diffstat (limited to 'src/corelib')
-rw-r--r-- | src/corelib/corelib.pro | 1 | ||||
-rw-r--r-- | src/corelib/plugin/qlibrary_unix.cpp | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/corelib/corelib.pro b/src/corelib/corelib.pro index b9bcc70e17..121db51eb5 100644 --- a/src/corelib/corelib.pro +++ b/src/corelib/corelib.pro @@ -12,6 +12,7 @@ CONFIG += qt_tracepoints CONFIG += $$MODULE_CONFIG DEFINES += $$MODULE_DEFINES +android: DEFINES += LIBS_SUFFIX='\\"_$${QT_ARCH}.so\\"' DEFINES += QT_NO_USING_NAMESPACE QT_NO_FOREACH msvc:equals(QT_ARCH, i386): QMAKE_LFLAGS += /BASE:0x67000000 diff --git a/src/corelib/plugin/qlibrary_unix.cpp b/src/corelib/plugin/qlibrary_unix.cpp index 85ada9197c..44d5513163 100644 --- a/src/corelib/plugin/qlibrary_unix.cpp +++ b/src/corelib/plugin/qlibrary_unix.cpp @@ -100,6 +100,9 @@ QStringList QLibraryPrivate::suffixes_sys(const QString& fullVersion) suffixes << QLatin1String(".so.%1").arg(fullVersion); } else { suffixes << QLatin1String(".so"); +# ifdef Q_OS_ANDROID + suffixes << QStringLiteral(LIBS_SUFFIX); +# endif } #endif # ifdef Q_OS_MAC @@ -226,7 +229,14 @@ bool QLibraryPrivate::load_sys() } else { attempt = path + prefixes.at(prefix) + name + suffixes.at(suffix); } + pHnd = dlopen(QFile::encodeName(attempt), dlFlags); +#ifdef Q_OS_ANDROID + if (!pHnd) { + auto attemptFromBundle = attempt; + pHnd = dlopen(QFile::encodeName(attemptFromBundle.replace(QLatin1Char('/'), QLatin1Char('_'))), dlFlags); + } +#endif if (!pHnd && fileName.startsWith(QLatin1Char('/')) && QFile::exists(attempt)) { // We only want to continue if dlopen failed due to that the shared library did not exist. |