diff --git a/src/corelib/CMakeLists.txt b/src/corelib/CMakeLists.txt index e7545084c13..f5c4ef6e7dd 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 297d721d537..eb1e9dac39c 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 ee66e1c3c31..b0088d4ce08 100644 --- a/src/corelib/thread/qthread_unix.cpp +++ b/src/corelib/thread/qthread_unix.cpp @@ -20,7 +20,9 @@ # endif #endif -#include +#if !defined(Q_OS_WASM) +# include +#endif #include "qthreadstorage.h" diff --git a/src/gui/CMakeLists.txt b/src/gui/CMakeLists.txt index 8c7fd791cd3..a733e886458 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 c8f5072cb83..473df5f66d6 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 -#endif #include #include #include diff --git a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp index 16437d39f92..171f95157d0 100644 --- a/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp +++ b/tests/auto/corelib/kernel/qeventloop/tst_qeventloop.cpp @@ -9,7 +9,9 @@ #include #include #if defined(Q_OS_UNIX) - #include + #if !defined(Q_OS_WASM) + #include + #endif #include #if defined(HAVE_GLIB) #include @@ -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(eventDispatcher) #if defined(HAVE_GLIB)