forked from qt-creator/qt-creator
QmlJS: Replace macro usage with HostOsInfo
Change-Id: Ie1e7c5eb5a5f700ae63b4bcc6c1a9b1a4ed7a426 Reviewed-by: Marco Benelli <marco.benelli@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
3f80732dfb
commit
b8c99a66b3
@@ -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,22 +639,18 @@ 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;
|
||||
|
||||
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":
|
||||
@@ -666,13 +663,9 @@ QString PluginDumper::resolvePlugin(const QDir &qmldirPath, const QString &qmldi
|
||||
# endif
|
||||
#elif defined(Q_OS_AIX)
|
||||
validSuffixList << QLatin1String(".a") << QLatin1String(".so");
|
||||
# elif defined(Q_OS_UNIX)
|
||||
#else
|
||||
validSuffixList << QLatin1String(".so");
|
||||
#endif
|
||||
|
||||
// Examples of valid library names:
|
||||
// libfoo.so
|
||||
|
||||
return resolvePlugin(qmldirPath, qmldirPluginPath, baseName, validSuffixList, QLatin1String("lib"));
|
||||
#endif
|
||||
}
|
||||
return resolvePlugin(qmldirPath, qmldirPluginPath, baseName, validSuffixList, prefix);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user