summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2020-09-15 12:37:15 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2020-09-15 23:50:44 +0200
commitc8ec83b2851526530937ff1189575ad7b339d903 (patch)
tree3f25513b99ee3cb00d960a3f040916d8d3dc6c77
parent13ba7e119e4eec4bc57c7717db0de947d1bfb3b8 (diff)
downloadqtwayland-c8ec83b2851526530937ff1189575ad7b339d903.tar.gz
Fix QtWayland build without qtdeclarative
Add qtwaylandqmlinclude.h indirection to define replacement defines. Change-Id: I0f319035f1a21a77a46f3397870be588ffa9a78a Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
-rw-r--r--src/compositor/CMakeLists.txt27
-rw-r--r--src/compositor/compositor.pro12
-rw-r--r--src/compositor/compositor_api/compositor_api.pri12
-rw-r--r--src/compositor/compositor_api/qwaylandclient.h2
-rw-r--r--src/compositor/compositor_api/qwaylandcompositor.h1
-rw-r--r--src/compositor/compositor_api/qwaylanddrag.h3
-rw-r--r--src/compositor/compositor_api/qwaylandkeymap.h2
-rw-r--r--src/compositor/compositor_api/qwaylandoutput.h1
-rw-r--r--src/compositor/compositor_api/qwaylandresource.h2
-rw-r--r--src/compositor/compositor_api/qwaylandseat.h3
-rw-r--r--src/compositor/compositor_api/qwaylandsurface.h5
-rw-r--r--src/compositor/extensions/extensions.pri2
-rw-r--r--src/compositor/extensions/qwaylandshell.h3
-rw-r--r--src/compositor/extensions/qwaylandshellsurface.h3
-rw-r--r--src/compositor/global/global.pri1
-rw-r--r--src/compositor/global/qtwaylandcompositorglobal.h2
-rw-r--r--src/compositor/global/qtwaylandqmlinclude.h57
-rw-r--r--src/compositor/global/qwaylandcompositorextension.h2
18 files changed, 105 insertions, 35 deletions
diff --git a/src/compositor/CMakeLists.txt b/src/compositor/CMakeLists.txt
index f727f0a1..08de121f 100644
--- a/src/compositor/CMakeLists.txt
+++ b/src/compositor/CMakeLists.txt
@@ -14,15 +14,12 @@ qt_add_module(WaylandCompositor
compositor_api/qwaylandbufferref.cpp compositor_api/qwaylandbufferref.h
compositor_api/qwaylandclient.cpp compositor_api/qwaylandclient.h
compositor_api/qwaylandcompositor.cpp compositor_api/qwaylandcompositor.h compositor_api/qwaylandcompositor_p.h
- compositor_api/qwaylandcompositorquickextensions_p.h
compositor_api/qwaylanddestroylistener.cpp compositor_api/qwaylanddestroylistener.h compositor_api/qwaylanddestroylistener_p.h
compositor_api/qwaylandkeyboard.cpp compositor_api/qwaylandkeyboard.h compositor_api/qwaylandkeyboard_p.h
compositor_api/qwaylandkeymap.cpp compositor_api/qwaylandkeymap.h compositor_api/qwaylandkeymap_p.h
- compositor_api/qwaylandmousetracker.cpp compositor_api/qwaylandmousetracker_p.h
compositor_api/qwaylandoutput.cpp compositor_api/qwaylandoutput.h compositor_api/qwaylandoutput_p.h
compositor_api/qwaylandoutputmode.cpp compositor_api/qwaylandoutputmode.h compositor_api/qwaylandoutputmode_p.h
compositor_api/qwaylandpointer.cpp compositor_api/qwaylandpointer.h compositor_api/qwaylandpointer_p.h
- compositor_api/qwaylandquickchildren.h
compositor_api/qwaylandresource.cpp compositor_api/qwaylandresource.h
compositor_api/qwaylandseat.cpp compositor_api/qwaylandseat.h compositor_api/qwaylandseat_p.h
compositor_api/qwaylandsurface.cpp compositor_api/qwaylandsurface.h compositor_api/qwaylandsurface_p.h
@@ -47,6 +44,7 @@ qt_add_module(WaylandCompositor
extensions/qwlqtkey.cpp extensions/qwlqtkey_p.h
extensions/qwlqttouch.cpp extensions/qwlqttouch_p.h
global/qtwaylandcompositorglobal.h
+ global/qtwaylandqmlinclude.h
global/qwaylandcompositorextension.cpp global/qwaylandcompositorextension.h global/qwaylandcompositorextension_p.h
global/qwaylandquickextension.h
global/qwaylandutils_p.h
@@ -183,6 +181,9 @@ qt_extend_target(WaylandCompositor CONDITION QT_FEATURE_draganddrop
qt_extend_target(WaylandCompositor CONDITION QT_FEATURE_wayland_compositor_quick
SOURCES
+ compositor_api/qwaylandcompositorquickextensions_p.h
+ compositor_api/qwaylandmousetracker.cpp compositor_api/qwaylandmousetracker_p.h
+ compositor_api/qwaylandquickchildren.h
compositor_api/qwaylandquickcompositor.cpp compositor_api/qwaylandquickcompositor.h
compositor_api/qwaylandquickitem.cpp compositor_api/qwaylandquickitem.h compositor_api/qwaylandquickitem_p.h
compositor_api/qwaylandquickoutput.cpp compositor_api/qwaylandquickoutput.h
@@ -216,15 +217,19 @@ qt_add_docs(WaylandCompositor
doc/qtwaylandcompositor.qdocconf
)
-set_target_properties(WaylandCompositor PROPERTIES
- QT_QML_MODULE_INSTALL_QMLTYPES TRUE
- QT_QML_MODULE_VERSION ${CMAKE_PROJECT_VERSION}
- QT_QML_MODULE_URI QtWayland.Compositor
- QT_QMLTYPES_FILENAME plugins.qmltypes
- QT_QML_MODULE_INSTALL_DIR "${INSTALL_QMLDIR}/QtWayland/Compositor"
-)
+# special case begin
+if (TARGET Qt::Qml)
+ set_target_properties(WaylandCompositor PROPERTIES
+ QT_QML_MODULE_INSTALL_QMLTYPES TRUE
+ QT_QML_MODULE_VERSION ${CMAKE_PROJECT_VERSION}
+ QT_QML_MODULE_URI QtWayland.Compositor
+ QT_QMLTYPES_FILENAME plugins.qmltypes
+ QT_QML_MODULE_INSTALL_DIR "${INSTALL_QMLDIR}/QtWayland/Compositor"
+ )
-qt6_qml_type_registration(WaylandCompositor)
+ qt6_qml_type_registration(WaylandCompositor)
+endif()
+# special case end
# special case begin
qt_record_extra_qt_package_dependency(WaylandCompositor WaylandScannerTools "")
diff --git a/src/compositor/compositor.pro b/src/compositor/compositor.pro
index 8a08494c..4fbbb2bc 100644
--- a/src/compositor/compositor.pro
+++ b/src/compositor/compositor.pro
@@ -37,9 +37,11 @@ MODULE_PLUGIN_TYPES = \
load(qt_module)
-QMLTYPES_FILENAME = plugins.qmltypes
-QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtWayland/Compositor
-QML_IMPORT_NAME = QtWayland.Compositor
-QML_IMPORT_VERSION = $$QT_VERSION
-CONFIG += qmltypes install_qmltypes
+qtConfig(wayland-compositor-quick) {
+ QMLTYPES_FILENAME = plugins.qmltypes
+ QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtWayland/Compositor
+ QML_IMPORT_NAME = QtWayland.Compositor
+ QML_IMPORT_VERSION = $$QT_VERSION
+ CONFIG += qmltypes install_qmltypes
+}
diff --git a/src/compositor/compositor_api/compositor_api.pri b/src/compositor/compositor_api/compositor_api.pri
index 7014b05c..342e1841 100644
--- a/src/compositor/compositor_api/compositor_api.pri
+++ b/src/compositor/compositor_api/compositor_api.pri
@@ -27,10 +27,7 @@ HEADERS += \
compositor_api/qwaylandview_p.h \
compositor_api/qwaylandresource.h \
compositor_api/qwaylandsurfacegrabber.h \
- compositor_api/qwaylandoutputmode_p.h \
- compositor_api/qwaylandquickchildren.h \
- compositor_api/qwaylandmousetracker_p.h \
- compositor_api/qwaylandcompositorquickextensions_p.h
+ compositor_api/qwaylandoutputmode_p.h
SOURCES += \
compositor_api/qwaylandcompositor.cpp \
@@ -47,8 +44,7 @@ SOURCES += \
compositor_api/qwaylanddestroylistener.cpp \
compositor_api/qwaylandview.cpp \
compositor_api/qwaylandresource.cpp \
- compositor_api/qwaylandsurfacegrabber.cpp \
- compositor_api/qwaylandmousetracker.cpp
+ compositor_api/qwaylandsurfacegrabber.cpp
qtConfig(im) {
HEADERS += \
@@ -69,12 +65,16 @@ qtConfig(draganddrop) {
qtConfig(wayland-compositor-quick) {
SOURCES += \
+ compositor_api/qwaylandmousetracker.cpp \
compositor_api/qwaylandquickcompositor.cpp \
compositor_api/qwaylandquicksurface.cpp \
compositor_api/qwaylandquickoutput.cpp \
compositor_api/qwaylandquickitem.cpp
HEADERS += \
+ compositor_api/qwaylandcompositorquickextensions_p.h \
+ compositor_api/qwaylandmousetracker_p.h \
+ compositor_api/qwaylandquickchildren.h \
compositor_api/qwaylandquickcompositor.h \
compositor_api/qwaylandquicksurface.h \
compositor_api/qwaylandquickoutput.h \
diff --git a/src/compositor/compositor_api/qwaylandclient.h b/src/compositor/compositor_api/qwaylandclient.h
index 9598990f..3d215aa7 100644
--- a/src/compositor/compositor_api/qwaylandclient.h
+++ b/src/compositor/compositor_api/qwaylandclient.h
@@ -30,8 +30,8 @@
#ifndef QWAYLANDCLIENT_H
#define QWAYLANDCLIENT_H
-#include <QtQml/qqml.h>
#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
+#include <QtWaylandCompositor/qtwaylandqmlinclude.h>
#include <QObject>
diff --git a/src/compositor/compositor_api/qwaylandcompositor.h b/src/compositor/compositor_api/qwaylandcompositor.h
index dae56b51..f7715107 100644
--- a/src/compositor/compositor_api/qwaylandcompositor.h
+++ b/src/compositor/compositor_api/qwaylandcompositor.h
@@ -31,6 +31,7 @@
#define QWAYLANDCOMPOSITOR_H
#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
+#include <QtWaylandCompositor/qtwaylandqmlinclude.h>
#include <QtWaylandCompositor/qwaylandcompositorextension.h>
#include <QtWaylandCompositor/QWaylandOutput>
diff --git a/src/compositor/compositor_api/qwaylanddrag.h b/src/compositor/compositor_api/qwaylanddrag.h
index 6519cd96..8e6861fb 100644
--- a/src/compositor/compositor_api/qwaylanddrag.h
+++ b/src/compositor/compositor_api/qwaylanddrag.h
@@ -31,12 +31,11 @@
#define QWAYLANDDRAG_H
#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
+#include <QtWaylandCompositor/qtwaylandqmlinclude.h>
#include <QtCore/QObject>
#include <QtCore/QPointF>
-#include <QtQml/qqml.h>
-
QT_REQUIRE_CONFIG(draganddrop);
QT_BEGIN_NAMESPACE
diff --git a/src/compositor/compositor_api/qwaylandkeymap.h b/src/compositor/compositor_api/qwaylandkeymap.h
index 01fcfbdf..42527761 100644
--- a/src/compositor/compositor_api/qwaylandkeymap.h
+++ b/src/compositor/compositor_api/qwaylandkeymap.h
@@ -31,8 +31,8 @@
#define QWAYLANDKEYMAP_H
#include <QtCore/QObject>
-#include <QtQml/qqml.h>
#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
+#include <QtWaylandCompositor/qtwaylandqmlinclude.h>
#include <QtWaylandCompositor/qwaylandquickchildren.h>
QT_BEGIN_NAMESPACE
diff --git a/src/compositor/compositor_api/qwaylandoutput.h b/src/compositor/compositor_api/qwaylandoutput.h
index fc885987..d8cc18da 100644
--- a/src/compositor/compositor_api/qwaylandoutput.h
+++ b/src/compositor/compositor_api/qwaylandoutput.h
@@ -31,6 +31,7 @@
#ifndef QWAYLANDOUTPUT_H
#define QWAYLANDOUTPUT_H
+#include <QtWaylandCompositor/qtwaylandqmlinclude.h>
#include <QtWaylandCompositor/qwaylandcompositorextension.h>
#include <QtWaylandCompositor/QWaylandOutputMode>
#include <QtCore/QObject>
diff --git a/src/compositor/compositor_api/qwaylandresource.h b/src/compositor/compositor_api/qwaylandresource.h
index e2802732..08642f0d 100644
--- a/src/compositor/compositor_api/qwaylandresource.h
+++ b/src/compositor/compositor_api/qwaylandresource.h
@@ -31,8 +31,8 @@
#define QWAYLANDRESOURCE_H
#include <QtCore/QObject>
-#include <QtQml/qqml.h>
#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
+#include <QtWaylandCompositor/qtwaylandqmlinclude.h>
struct wl_resource;
diff --git a/src/compositor/compositor_api/qwaylandseat.h b/src/compositor/compositor_api/qwaylandseat.h
index 3cb2e0b0..60d090e9 100644
--- a/src/compositor/compositor_api/qwaylandseat.h
+++ b/src/compositor/compositor_api/qwaylandseat.h
@@ -35,8 +35,10 @@
#include <QtCore/QString>
#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
+#include <QtWaylandCompositor/qtwaylandqmlinclude.h>
#include <QtWaylandCompositor/qwaylandcompositorextension.h>
#include <QtWaylandCompositor/qwaylandkeyboard.h>
+#include <QtWaylandCompositor/qwaylandview.h>
QT_BEGIN_NAMESPACE
@@ -44,7 +46,6 @@ class QWaylandCompositor;
class QWaylandSurface;
class QKeyEvent;
class QTouchEvent;
-class QWaylandView;
class QInputEvent;
class QWaylandSeatPrivate;
class QWaylandDrag;
diff --git a/src/compositor/compositor_api/qwaylandsurface.h b/src/compositor/compositor_api/qwaylandsurface.h
index d66e276b..8558866b 100644
--- a/src/compositor/compositor_api/qwaylandsurface.h
+++ b/src/compositor/compositor_api/qwaylandsurface.h
@@ -32,8 +32,10 @@
#define QWAYLANDSURFACE_H
#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
+#include <QtWaylandCompositor/qwaylandcompositor.h>
#include <QtWaylandCompositor/qwaylandcompositorextension.h>
#include <QtWaylandCompositor/qwaylandclient.h>
+#include <QtWaylandCompositor/qwaylanddrag.h>
#include <QtCore/QScopedPointer>
#include <QtGui/QImage>
@@ -46,14 +48,11 @@ struct wl_resource;
QT_BEGIN_NAMESPACE
class QTouchEvent;
-class QWaylandClient;
class QWaylandSurfacePrivate;
-class QWaylandCompositor;
class QWaylandBufferRef;
class QWaylandView;
class QWaylandSurfaceOp;
class QWaylandInputMethodControl;
-class QWaylandDrag;
class QWaylandSurfaceRole
{
diff --git a/src/compositor/extensions/extensions.pri b/src/compositor/extensions/extensions.pri
index 5c3ab0f4..a08f6820 100644
--- a/src/compositor/extensions/extensions.pri
+++ b/src/compositor/extensions/extensions.pri
@@ -70,7 +70,7 @@ SOURCES += \
extensions/qwaylandiviapplication.cpp \
extensions/qwaylandivisurface.cpp \
-qtHaveModule(quick) {
+qtConfig(wayland-compositor-quick) {
QT += quick quick-private
HEADERS += \
diff --git a/src/compositor/extensions/qwaylandshell.h b/src/compositor/extensions/qwaylandshell.h
index 739fd8f2..987f728f 100644
--- a/src/compositor/extensions/qwaylandshell.h
+++ b/src/compositor/extensions/qwaylandshell.h
@@ -30,7 +30,8 @@
#ifndef QWAYLANDSHELL_H
#define QWAYLANDSHELL_H
-#include <QtWaylandCompositor/QWaylandCompositorExtension>
+#include <QtWaylandCompositor/qtwaylandqmlinclude.h>
+#include <QtWaylandCompositor/qwaylandcompositorextension.h>
QT_BEGIN_NAMESPACE
diff --git a/src/compositor/extensions/qwaylandshellsurface.h b/src/compositor/extensions/qwaylandshellsurface.h
index 67450e54..ae2a1b2a 100644
--- a/src/compositor/extensions/qwaylandshellsurface.h
+++ b/src/compositor/extensions/qwaylandshellsurface.h
@@ -30,7 +30,8 @@
#ifndef QWAYLANDSHELLSURFACE_H
#define QWAYLANDSHELLSURFACE_H
-#include <QtWaylandCompositor/QWaylandCompositorExtension>
+#include <QtWaylandCompositor/qtwaylandqmlinclude.h>
+#include <QtWaylandCompositor/qwaylandcompositorextension.h>
QT_BEGIN_NAMESPACE
diff --git a/src/compositor/global/global.pri b/src/compositor/global/global.pri
index 172f916b..e12df2dd 100644
--- a/src/compositor/global/global.pri
+++ b/src/compositor/global/global.pri
@@ -2,6 +2,7 @@ INCLUDEPATH += global/
HEADERS += \
global/qtwaylandcompositorglobal.h \
+ global/qtwaylandqmlinclude.h \
global/qwaylandcompositorextension.h \
global/qwaylandcompositorextension_p.h \
global/qwaylandutils_p.h \
diff --git a/src/compositor/global/qtwaylandcompositorglobal.h b/src/compositor/global/qtwaylandcompositorglobal.h
index cd8cd9ef..4c5e51ed 100644
--- a/src/compositor/global/qtwaylandcompositorglobal.h
+++ b/src/compositor/global/qtwaylandcompositorglobal.h
@@ -58,7 +58,9 @@ QT_BEGIN_NAMESPACE
QT_END_NAMESPACE
+#if QT_CONFIG(wayland_compositor_quick)
void Q_WAYLAND_COMPOSITOR_EXPORT qml_register_types_QtWayland_Compositor();
+#endif
#endif // QWAYLANDCOMPOSITORGLOBAL_H
diff --git a/src/compositor/global/qtwaylandqmlinclude.h b/src/compositor/global/qtwaylandqmlinclude.h
new file mode 100644
index 00000000..3e4b758e
--- /dev/null
+++ b/src/compositor/global/qtwaylandqmlinclude.h
@@ -0,0 +1,57 @@
+/****************************************************************************
+**
+** Copyright (C) 2020 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the plugins of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 or (at your option) any later version
+** approved by the KDE Free Qt Foundation. The licenses are as published by
+** the Free Software Foundation and appearing in the file LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QTWAYLANDQMLINCLUDE_H
+#define QTWAYLANDQMLINCLUDE_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+#include <QtCore/qglobal.h>
+#include <QtWaylandCompositor/qtwaylandcompositor-config.h>
+
+#if QT_CONFIG(wayland_compositor_quick)
+#include <QtQml/qqml.h>
+#else
+#define QML_NAMED_ELEMENT(x)
+#define QML_UNCREATABLE(x)
+#define QML_ADDED_IN_VERSION(x, y)
+#endif
+
+QT_BEGIN_NAMESPACE
+QT_END_NAMESPACE
+
+#endif // QTWAYLANDQMLINCLUDE_H
diff --git a/src/compositor/global/qwaylandcompositorextension.h b/src/compositor/global/qwaylandcompositorextension.h
index ccb6dd0f..e9bebebb 100644
--- a/src/compositor/global/qwaylandcompositorextension.h
+++ b/src/compositor/global/qwaylandcompositorextension.h
@@ -30,8 +30,8 @@
#ifndef QWAYLANDEXTENSION_H
#define QWAYLANDEXTENSION_H
-#include <QtQml/qqml.h>
#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
+#include <QtWaylandCompositor/qtwaylandqmlinclude.h>
#include <QtCore/QObject>