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 <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);
}