From b8c99a66b3f7d924b378be98a5bf136b7db00d55 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sat, 10 Sep 2016 22:56:52 +0300 Subject: QmlJS: Replace macro usage with HostOsInfo Change-Id: Ie1e7c5eb5a5f700ae63b4bcc6c1a9b1a4ed7a426 Reviewed-by: Marco Benelli --- src/libs/qmljs/qmljsplugindumper.cpp | 53 ++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 30 deletions(-) (limited to 'src/libs/qmljs/qmljsplugindumper.cpp') 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 #include #include +#include #include #include @@ -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); } -- cgit v1.2.3