diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2021-06-18 17:07:44 +0200 |
---|---|---|
committer | Joerg Bornemann <joerg.bornemann@qt.io> | 2021-07-05 15:30:02 +0200 |
commit | a2259cac9bdb3feb5b2312a928125a1ddd40af6d (patch) | |
tree | 4d4537a8222981c78845f6f59b837f016675d30f /src/compositor | |
parent | 809176b8bccb4e0644f484a44189749ee87e2e3e (diff) | |
download | qtwayland-a2259cac9bdb3feb5b2312a928125a1ddd40af6d.tar.gz |
Restructure configure features
Create a new module WaylandGlobalPrivate that is merely a collection of
build features that are shared by client, compositor and plugins of
qtwayland.
Move the features wayland-client and wayland-server to
WaylandGlobalPrivate to be able to access both features in
src/CMakeLists.txt. This removes the need for explicitly including the
configure.cmake files of client and compositor, which fixes QTBUG-88261.
Move the features that are defined in both, client and compositor, to
WaylandGlobalPrivate.
The module is defined in src/CMakeLists.txt to ensure that the
targets created by the qt_find_package calls in src/configure.cmake are
accessible in subdirectories below src/.
We need the (nearly) empty src/global directory to satisfy syncqt.
We cannot pass NO_SYNC_QT to qt_internal_add_module, because that
prevents the creation of qtwaylandglobal-config_p.h.
Fixes: QTBUG-88261
Fixes: QTBUG-91705
Change-Id: I776632a86ffe96886dc12f1f675f9ab56a2faf2a
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
Reviewed-by: Alexey Edelev <alexey.edelev@qt.io>
Diffstat (limited to 'src/compositor')
-rw-r--r-- | src/compositor/CMakeLists.txt | 2 | ||||
-rw-r--r-- | src/compositor/configure.cmake | 160 | ||||
-rw-r--r-- | src/compositor/global/qtwaylandcompositorglobal_p.h | 1 |
3 files changed, 3 insertions, 160 deletions
diff --git a/src/compositor/CMakeLists.txt b/src/compositor/CMakeLists.txt index e956c3b6..7bc1d070 100644 --- a/src/compositor/CMakeLists.txt +++ b/src/compositor/CMakeLists.txt @@ -60,6 +60,7 @@ qt_internal_add_module(WaylandCompositor LIBRARIES Qt::CorePrivate Qt::GuiPrivate + Qt::WaylandGlobalPrivate PUBLIC_LIBRARIES Qt::Core Qt::Gui @@ -67,6 +68,7 @@ qt_internal_add_module(WaylandCompositor PRIVATE_MODULE_INTERFACE Qt::CorePrivate Qt::GuiPrivate + Qt::WaylandGlobalPrivate ) # Resources: diff --git a/src/compositor/configure.cmake b/src/compositor/configure.cmake index 9c5864e3..3f33ed38 100644 --- a/src/compositor/configure.cmake +++ b/src/compositor/configure.cmake @@ -1,5 +1,3 @@ - - #### Inputs @@ -7,106 +5,13 @@ #### Libraries if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) - qt_find_package(Wayland PROVIDED_TARGETS Wayland::Server MODULE_NAME waylandcompositor QMAKE_LIB wayland-server) -endif() -if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) - qt_find_package(Wayland PROVIDED_TARGETS Wayland::Egl MODULE_NAME waylandcompositor QMAKE_LIB wayland-egl) -endif() -if((LINUX) OR QT_FIND_ALL_PACKAGES_ALWAYS) qt_find_package(Waylandkms PROVIDED_TARGETS PkgConfig::Waylandkms MODULE_NAME waylandcompositor QMAKE_LIB wayland-kms) endif() -qt_find_package(XComposite PROVIDED_TARGETS PkgConfig::XComposite MODULE_NAME waylandcompositor QMAKE_LIB xcomposite) # special case begin -# X11 is not a public dependency of QtGui anymore, so we need to find it manually in a shared build. -# In a static build the dependency is still propagated, so check for the target existence to prevent -# the 'Attempt to promote imported target "X11::X11" to global scope' issue. -if(NOT TARGET X11::X11) - qt_find_package(X11 PROVIDED_TARGETS X11::X11 MODULE_NAME gui QMAKE_LIB xlib) -endif() -# Same for XKB. -if(NOT TARGET XKB::XKB) - qt_find_package(XKB 0.5.0 PROVIDED_TARGETS XKB::XKB MODULE_NAME gui QMAKE_LIB xkbcommon MARK_OPTIONAL) -endif() #### Tests -# drm-egl-server -qt_config_compile_test(drm_egl_server - LIBRARIES - EGL::EGL - CODE -" -#include <EGL/egl.h> -#include <EGL/eglext.h> - -int main(int argc, char **argv) -{ - (void)argc; (void)argv; - /* BEGIN TEST: */ -#ifdef EGL_MESA_drm_image -return 0; -#else -#error Requires EGL_MESA_drm_image to be defined -return 1; -#endif - /* END TEST: */ - return 0; -} -") - -# libhybris-egl-server -qt_config_compile_test(libhybris_egl_server - LIBRARIES - EGL::EGL - CODE -" -#include <EGL/egl.h> -#include <EGL/eglext.h> -#include <hybris/eglplatformcommon/hybris_nativebufferext.h> - -int main(int argc, char **argv) -{ - (void)argc; (void)argv; - /* BEGIN TEST: */ -#ifdef EGL_HYBRIS_native_buffer -return 0; -#else -#error Requires EGL_HYBRIS_native_buffer to be defined -return 1; -#endif - /* END TEST: */ - return 0; -} -") - -# dmabuf-server-buffer -qt_config_compile_test(dmabuf_server_buffer - LABEL "Linux dma-buf Buffer Sharing" - LIBRARIES - EGL::EGL - Libdrm::Libdrm - CODE -" -#include <EGL/egl.h> -#include <EGL/eglext.h> -#include <drm_fourcc.h> - -int main(int argc, char **argv) -{ - (void)argc; (void)argv; - /* BEGIN TEST: */ -#ifdef EGL_LINUX_DMA_BUF_EXT -return 0; -#else -#error Requires EGL_LINUX_DMA_BUF_EXT -return 1; -#endif - /* END TEST: */ - return 0; -} -") - # dmabuf-client-buffer qt_config_compile_test(dmabuf_client_buffer LABEL "Linux Client dma-buf Buffer Sharing" @@ -138,77 +43,13 @@ return 0; } ") -# vulkan-server-buffer -qt_config_compile_test(vulkan_server_buffer - LABEL "Vulkan Buffer Sharing" - CODE -"#define VK_USE_PLATFORM_WAYLAND_KHR 1 -#include <vulkan/vulkan.h> - -int main(int argc, char **argv) -{ - (void)argc; (void)argv; - /* BEGIN TEST: */ -VkExportMemoryAllocateInfoKHR exportAllocInfo = {}; -exportAllocInfo.sType = VK_STRUCTURE_TYPE_EXPORT_MEMORY_ALLOCATE_INFO_KHR; -exportAllocInfo.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR; -return 0; - /* END TEST: */ - return 0; -} -") - - #### Features -qt_feature("wayland-server" PRIVATE - LABEL "Qt Wayland Compositor" - CONDITION NOT WIN32 AND Wayland_FOUND AND WaylandScanner_FOUND -) -qt_feature("wayland-datadevice" PRIVATE - CONDITION QT_FEATURE_draganddrop OR QT_FEATURE_clipboard -) -qt_feature("wayland-egl" PRIVATE - LABEL "EGL" - CONDITION QT_FEATURE_wayland_server AND QT_FEATURE_opengl AND QT_FEATURE_egl AND Wayland_FOUND -) -qt_feature("wayland-brcm" PRIVATE - LABEL "Raspberry Pi" - CONDITION QT_FEATURE_wayland_server AND QT_FEATURE_eglfs_brcm -) -qt_feature("xcomposite-egl" PRIVATE - LABEL "XComposite EGL" - CONDITION QT_FEATURE_wayland_server AND QT_FEATURE_egl AND QT_FEATURE_opengl AND XComposite_FOUND -) -qt_feature("xcomposite-glx" PRIVATE - LABEL "XComposite EGL" - CONDITION QT_FEATURE_wayland_server AND QT_FEATURE_opengl AND NOT QT_FEATURE_opengles2 AND QT_FEATURE_xlib AND XComposite_FOUND -) -qt_feature("wayland-drm-egl-server-buffer" PRIVATE - LABEL "DRM EGL" - CONDITION QT_FEATURE_wayland_server AND QT_FEATURE_opengl AND QT_FEATURE_egl AND TEST_drm_egl_server -) -qt_feature("wayland-libhybris-egl-server-buffer" PRIVATE - LABEL "libhybris EGL" - CONDITION QT_FEATURE_wayland_server AND QT_FEATURE_opengl AND QT_FEATURE_egl AND TEST_libhybris_egl_server -) -qt_feature("wayland-dmabuf-server-buffer" PRIVATE - LABEL "Linux dma-buf server buffer integration" - CONDITION QT_FEATURE_wayland_server AND QT_FEATURE_opengl AND QT_FEATURE_egl AND TEST_dmabuf_server_buffer -) qt_feature("wayland-dmabuf-client-buffer" PRIVATE LABEL "Linux dma-buf client buffer integration" CONDITION QT_FEATURE_wayland_server AND QT_FEATURE_opengl AND QT_FEATURE_egl AND TEST_dmabuf_client_buffer ) -qt_feature("wayland-vulkan-server-buffer" PRIVATE - LABEL "Vulkan-based server buffer integration" - CONDITION QT_FEATURE_wayland_server AND QT_FEATURE_vulkan AND QT_FEATURE_opengl AND QT_FEATURE_egl AND TEST_vulkan_server_buffer -) -qt_feature("wayland-shm-emulation-server-buffer" PRIVATE - LABEL "Shm emulation server buffer" - CONDITION QT_FEATURE_wayland_server AND QT_FEATURE_opengl -) qt_feature("wayland-layer-integration-vsp2" PRIVATE LABEL "VSP2 hardware layer integration" CONDITION QT_FEATURE_wayland_server AND QT_FEATURE_eglfs_vsp2 AND Waylandkms_FOUND @@ -218,7 +59,6 @@ qt_feature("wayland-compositor-quick" PUBLIC PURPOSE "Allows QtWayland compositor types to be used with QtQuick" CONDITION QT_FEATURE_wayland_server AND TARGET Qt::Quick ) -qt_configure_add_summary_entry(ARGS "wayland-server") qt_configure_add_summary_section(NAME "Qt Wayland Compositor Layer Plugins") qt_configure_add_summary_entry(ARGS "wayland-layer-integration-vsp2") qt_configure_end_summary_section() # end of "Qt Wayland Compositor Layer Plugins" section diff --git a/src/compositor/global/qtwaylandcompositorglobal_p.h b/src/compositor/global/qtwaylandcompositorglobal_p.h index 11a4a3d7..102e738e 100644 --- a/src/compositor/global/qtwaylandcompositorglobal_p.h +++ b/src/compositor/global/qtwaylandcompositorglobal_p.h @@ -41,6 +41,7 @@ // We mean it. // +#include <QtWaylandGlobal/private/qtwaylandglobal-config_p.h> #include <QtWaylandCompositor/qtwaylandcompositorglobal.h> #include <QtGui/private/qtguiglobal_p.h> #include <QtWaylandCompositor/private/qtwaylandcompositor-config_p.h> |