diff options
author | Mikolaj Boc <mikolaj.boc@qt.io> | 2023-07-31 15:42:35 +0200 |
---|---|---|
committer | Mikolaj Boc <mikolaj.boc@qt.io> | 2023-08-22 17:19:50 +0200 |
commit | 234f03a0b3d387447ccd5546697ef58338710554 (patch) | |
tree | becf70d2c4ca9c8278c38c5da3e1b77458dda744 | |
parent | 462904d46bf2c44ed196a7794838655698ede6c2 (diff) |
Remove the unix dispatcher from WASM builds
Unix dispatcher is not used and - as such - redundant on WASM.
Change-Id: Ia8789ef783b06ce9cfba2ce9d67159db2355b594
Reviewed-by: MikoĊaj Boc <Mikolaj.Boc@qt.io>
-rw-r--r-- | src/corelib/CMakeLists.txt | 6 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreapplication.cpp | 4 | ||||
-rw-r--r-- | src/corelib/thread/qthread_unix.cpp | 4 | ||||
-rw-r--r-- | src/gui/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/plugins/platforms/wasm/qwasmintegration.cpp | 3 | ||||
-rw-r--r-- | tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp | 6 |
6 files changed, 16 insertions, 9 deletions
diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index e7545084c1..f5c4ef6e7d 100644 --- a/src/corelib/CMakeLists.txt +++ b/src/corelib/CMakeLists.txt @@ -659,12 +659,16 @@ qt_internal_extend_target(Core CONDITION UNIX io/qfsfileengine_unix.cpp io/qlockfile_unix.cpp kernel/qcore_unix.cpp kernel/qcore_unix_p.h - kernel/qeventdispatcher_unix.cpp kernel/qeventdispatcher_unix_p.h kernel/qpoll_p.h kernel/qtimerinfo_unix.cpp kernel/qtimerinfo_unix_p.h thread/qthread_unix.cpp ) +qt_internal_extend_target(Core CONDITION UNIX AND NOT WASM + SOURCES + kernel/qeventdispatcher_unix.cpp kernel/qeventdispatcher_unix_p.h +) + qt_internal_extend_target(Core CONDITION QT_FEATURE_thread SOURCES thread/qatomic.cpp diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp index 297d721d53..eb1e9dac39 100644 --- a/src/corelib/kernel/qcoreapplication.cpp +++ b/src/corelib/kernel/qcoreapplication.cpp @@ -56,7 +56,9 @@ # include "qeventdispatcher_glib_p.h" # endif # endif -# include "qeventdispatcher_unix_p.h" +# if !defined(Q_OS_WASM) +# include "qeventdispatcher_unix_p.h" +# endif #endif #ifdef Q_OS_WIN #include "qeventdispatcher_win_p.h" diff --git a/src/corelib/thread/qthread_unix.cpp b/src/corelib/thread/qthread_unix.cpp index ee66e1c3c3..b0088d4ce0 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -20,7 +20,9 @@ # endif #endif -#include <private/qeventdispatcher_unix_p.h> +#if !defined(Q_OS_WASM) +# include <private/qeventdispatcher_unix_p.h> +#endif #include "qthreadstorage.h" diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 8c7fd791cd..a733e88645 100644 --- a/src/gui/CMakeLists.txt +++ b/src/gui/CMakeLists.txt @@ -920,7 +920,7 @@ qt_internal_extend_target(Gui CONDITION WASM platform/wasm/qwasmlocalfileaccess.cpp platform/wasm/qwasmlocalfileaccess_p.h ) -qt_internal_extend_target(Gui CONDITION UNIX +qt_internal_extend_target(Gui CONDITION UNIX AND NOT WASM SOURCES platform/unix/qgenericunixeventdispatcher.cpp platform/unix/qgenericunixeventdispatcher_p.h platform/unix/qunixeventdispatcher.cpp diff --git a/src/plugins/platforms/wasm/qwasmintegration.cpp b/src/plugins/platforms/wasm/qwasmintegration.cpp index c8f5072cb8..473df5f66d 100644 --- a/src/plugins/platforms/wasm/qwasmintegration.cpp +++ b/src/plugins/platforms/wasm/qwasmintegration.cpp @@ -14,9 +14,6 @@ #include "qwasmwindow.h" #include "qwasmbackingstore.h" #include "qwasmfontdatabase.h" -#if defined(Q_OS_UNIX) -#include <QtGui/private/qgenericunixeventdispatcher_p.h> -#endif #include <qpa/qplatformwindow.h> #include <QtGui/qscreen.h> #include <qpa/qwindowsysteminterface.h> diff --git a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp index 16437d39f9..171f95157d 100644 --- a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp +++ b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp @@ -9,7 +9,9 @@ #include <qeventloop.h> #include <private/qeventloop_p.h> #if defined(Q_OS_UNIX) - #include <private/qeventdispatcher_unix_p.h> + #if !defined(Q_OS_WASM) + #include <private/qeventdispatcher_unix_p.h> + #endif #include <QtCore/private/qcore_unix_p.h> #if defined(HAVE_GLIB) #include <private/qeventdispatcher_glib_p.h> @@ -486,7 +488,7 @@ void tst_QEventLoop::processEventsExcludeTimers() // but not if we exclude timers eventLoop.processEvents(QEventLoop::X11ExcludeTimers); -#if defined(Q_OS_UNIX) +#if defined(Q_OS_UNIX) && !defined(Q_OS_WASM) QAbstractEventDispatcher *eventDispatcher = QCoreApplication::eventDispatcher(); if (!qobject_cast<QEventDispatcherUNIX *>(eventDispatcher) #if defined(HAVE_GLIB) |