QmlJS: Replace macro usage with HostOsInfo

Change-Id: Ie1e7c5eb5a5f700ae63b4bcc6c1a9b1a4ed7a426
Reviewed-by: Marco Benelli <marco.benelli@qt.io>
This commit is contained in:
Orgad Shaneh
2016-09-10 22:56:52 +03:00
committed by Orgad Shaneh
parent 3f80732dfb
commit b8c99a66b3

View File

@@ -32,6 +32,7 @@
//#include <coreplugin/messagemanager.h> //#include <coreplugin/messagemanager.h>
#include <utils/filesystemwatcher.h> #include <utils/filesystemwatcher.h>
#include <utils/fileutils.h> #include <utils/fileutils.h>
#include <utils/hostosinfo.h>
#include <QDir> #include <QDir>
#include <QRegularExpression> #include <QRegularExpression>
@@ -638,23 +639,19 @@ QString PluginDumper::resolvePlugin(const QDir &qmldirPath, const QString &qmldi
QString PluginDumper::resolvePlugin(const QDir &qmldirPath, const QString &qmldirPluginPath, QString PluginDumper::resolvePlugin(const QDir &qmldirPath, const QString &qmldirPluginPath,
const QString &baseName) 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; QStringList validSuffixList;
QString prefix;
# if defined(Q_OS_HPUX) 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": 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), "In PA-RISC (PA-32 and PA-64) shared libraries are suffixed with .sl. In IPF (32-bit and 64-bit),
@@ -664,15 +661,11 @@ QString PluginDumper::resolvePlugin(const QDir &qmldirPath, const QString &qmldi
# if defined __ia64 # if defined __ia64
validSuffixList << QLatin1String(".so"); validSuffixList << QLatin1String(".so");
# endif # endif
# elif defined(Q_OS_AIX) #elif defined(Q_OS_AIX)
validSuffixList << QLatin1String(".a") << QLatin1String(".so"); validSuffixList << QLatin1String(".a") << QLatin1String(".so");
# elif defined(Q_OS_UNIX) #else
validSuffixList << QLatin1String(".so"); validSuffixList << QLatin1String(".so");
# endif
// Examples of valid library names:
// libfoo.so
return resolvePlugin(qmldirPath, qmldirPluginPath, baseName, validSuffixList, QLatin1String("lib"));
#endif #endif
}
return resolvePlugin(qmldirPath, qmldirPluginPath, baseName, validSuffixList, prefix);
} }