Corelib: implement support for COFF-PE & DLLs in CYGWIN
Much of the code was already implemented for WIN32. The patch adds relevant code and implements few exceptions for CYGWIN. Change-Id: I0621075a8a989f64a4c2391d25220ef1686342d8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
b98c251bfa
commit
05d090b8e7
@ -561,6 +561,11 @@ qt_internal_extend_target(Core CONDITION QT_FEATURE_thread AND WIN32
|
||||
synchronization
|
||||
)
|
||||
|
||||
qt_internal_extend_target(Core CONDITION CYGWIN
|
||||
SOURCES
|
||||
global/qt_windows.h
|
||||
)
|
||||
|
||||
qt_internal_extend_target(Core CONDITION WIN32
|
||||
SOURCES
|
||||
global/qoperatingsystemversion_win.cpp global/qoperatingsystemversion_win_p.h
|
||||
@ -1187,6 +1192,10 @@ qt_internal_extend_target(Core CONDITION QT_FEATURE_library
|
||||
SOURCES
|
||||
plugin/qlibrary.cpp plugin/qlibrary.h plugin/qlibrary_p.h
|
||||
)
|
||||
qt_internal_extend_target(Core CONDITION QT_FEATURE_library AND CYGWIN
|
||||
SOURCES
|
||||
plugin/qcoffpeparser.cpp plugin/qcoffpeparser_p.h
|
||||
)
|
||||
qt_internal_extend_target(Core CONDITION QT_FEATURE_library AND WIN32
|
||||
SOURCES
|
||||
plugin/qcoffpeparser.cpp plugin/qcoffpeparser_p.h
|
||||
|
@ -9,6 +9,9 @@
|
||||
|
||||
#include <optional>
|
||||
|
||||
// Include minimal set of headers
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#define NOGDI
|
||||
#include <qt_windows.h>
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
@ -18,7 +18,7 @@
|
||||
|
||||
#include "qlibrary_p.h"
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
|
||||
@ -29,6 +29,6 @@ struct QCoffPeParser
|
||||
|
||||
QT_END_NAMESPACE
|
||||
|
||||
#endif // defined(Q_OF_ELF) && defined(Q_CC_GNU)
|
||||
#endif // Q_OS_WIN || Q_OS_CYGWIN
|
||||
|
||||
#endif // QCOFFPEPARSER_H
|
||||
|
@ -304,7 +304,7 @@ inline void QFactoryLoaderPrivate::updateSinglePath(const QString &path)
|
||||
qCDebug(lcFactoryLoader) << "checking directory path" << path << "...";
|
||||
|
||||
QDirListing plugins(path,
|
||||
#if defined(Q_OS_WIN)
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
|
||||
QStringList(QStringLiteral("*.dll")),
|
||||
#elif defined(Q_OS_ANDROID)
|
||||
QStringList("libplugins_%1_*.so"_L1.arg(suffix)),
|
||||
|
@ -177,7 +177,7 @@ static QLibraryScanResult qt_find_pattern(const char *s, qsizetype s_len, QStrin
|
||||
return QElfParser::parse({s, s_len}, errMsg);
|
||||
#elif defined(Q_OF_MACH_O)
|
||||
return QMachOParser::parse(s, s_len, errMsg);
|
||||
#elif defined(Q_OS_WIN)
|
||||
#elif defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
|
||||
return QCoffPeParser::parse({s, s_len}, errMsg);
|
||||
#else
|
||||
# warning "Qt does not know how to efficiently parse your platform's binary format; using slow fall-back."
|
||||
@ -615,7 +615,7 @@ QtPluginInstanceFunction QLibraryPrivate::loadPlugin()
|
||||
*/
|
||||
bool QLibrary::isLibrary(const QString &fileName)
|
||||
{
|
||||
#if defined(Q_OS_WIN)
|
||||
#if defined(Q_OS_WIN) || defined(Q_OS_CYGWIN)
|
||||
return fileName.endsWith(".dll"_L1, Qt::CaseInsensitive);
|
||||
#else // Generic Unix
|
||||
# if defined(Q_OS_DARWIN)
|
||||
|
@ -83,6 +83,8 @@ public:
|
||||
{
|
||||
#ifdef Q_OS_WIN
|
||||
return {};
|
||||
#elif defined(Q_OS_CYGWIN)
|
||||
return u"cyg";
|
||||
#else
|
||||
return u"lib";
|
||||
#endif
|
||||
|
@ -53,6 +53,12 @@ QStringList QLibraryPrivate::suffixes_sys(const QString &fullVersion)
|
||||
} else {
|
||||
suffixes << ".sl"_L1;
|
||||
}
|
||||
#elif defined(Q_OS_CYGWIN)
|
||||
if (!fullVersion.isEmpty()) {
|
||||
suffixes << "-%1.dll"_L1.arg(fullVersion);
|
||||
} else {
|
||||
suffixes << QStringLiteral(".dll");
|
||||
}
|
||||
#elif defined(Q_OS_AIX)
|
||||
suffixes << ".a";
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user