diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2016-09-10 22:56:52 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2016-09-12 13:21:03 +0000 |
commit | b8c99a66b3f7d924b378be98a5bf136b7db00d55 (patch) | |
tree | dd6ac730eb13122547addb94f4a810232d36f93b /src/libs/qmljs/qmljsplugindumper.cpp | |
parent | 3f80732dfbb98a6b9f77034b3d74e7eca4de3d5b (diff) |
QmlJS: Replace macro usage with HostOsInfo
Change-Id: Ie1e7c5eb5a5f700ae63b4bcc6c1a9b1a4ed7a426
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
Diffstat (limited to 'src/libs/qmljs/qmljsplugindumper.cpp')
-rw-r--r-- | src/libs/qmljs/qmljsplugindumper.cpp | 53 |
1 files changed, 23 insertions, 30 deletions
diff --git a/src/libs/qmljs/qmljsplugindumper.cpp b/src/libs/qmljs/qmljsplugindumper.cpp index 0950f76749..1f3d6c68c6 100644 --- a/src/libs/qmljs/qmljsplugindumper.cpp +++ b/src/libs/qmljs/qmljsplugindumper.cpp @@ -32,6 +32,7 @@ //#include <coreplugin/messagemanager.h> #include <utils/filesystemwatcher.h> #include <utils/fileutils.h> +#include <utils/hostosinfo.h> #include <QDir> #include <QRegularExpression> @@ -638,41 +639,33 @@ QString PluginDumper::resolvePlugin(const QDir &qmldirPath, const QString &qmldi QString PluginDumper::resolvePlugin(const QDir &qmldirPath, const QString &qmldirPluginPath, const QString &baseName) { -#if defined(Q_OS_WIN32) || defined(Q_OS_WINCE) - return resolvePlugin(qmldirPath, qmldirPluginPath, baseName, - QStringList() - << QLatin1String("d.dll") // try a qmake-style debug build first - << QLatin1String(".dll")); -#elif defined(Q_OS_DARWIN) - return resolvePlugin(qmldirPath, qmldirPluginPath, baseName, - QStringList() - << QLatin1String("_debug.dylib") // try a qmake-style debug build first - << QLatin1String(".dylib") - << QLatin1String(".so") - << QLatin1String(".bundle"), - QLatin1String("lib")); -#else // Generic Unix QStringList validSuffixList; - -# if defined(Q_OS_HPUX) + QString prefix; + if (Utils::HostOsInfo::isWindowsHost()) { + // try a qmake-style debug build first + validSuffixList = QStringList({ "d.dll", ".dll" }); + } else if (Utils::HostOsInfo::isMacHost()) { + // try a qmake-style debug build first + validSuffixList = QStringList({ "_debug.dylib", ".dylib", ".so", ".bundle", "lib" }); + } else { + // Examples of valid library names: + // libfoo.so + prefix = "lib"; +#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 - validSuffixList << QLatin1String(".so"); -# endif -# elif defined(Q_OS_AIX) - validSuffixList << QLatin1String(".a") << QLatin1String(".so"); -# elif defined(Q_OS_UNIX) - validSuffixList << QLatin1String(".so"); -# endif - - // Examples of valid library names: - // libfoo.so - - return resolvePlugin(qmldirPath, qmldirPluginPath, baseName, validSuffixList, QLatin1String("lib")); + validSuffixList << QLatin1String(".sl"); +# if defined __ia64 + validSuffixList << QLatin1String(".so"); +# endif +#elif defined(Q_OS_AIX) + validSuffixList << QLatin1String(".a") << QLatin1String(".so"); +#else + validSuffixList << QLatin1String(".so"); #endif + } + return resolvePlugin(qmldirPath, qmldirPluginPath, baseName, validSuffixList, prefix); } |