From f1b5619ca066bec13c69ce33681f0f1f6a0e449a Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 22 Sep 2020 12:29:17 +0200 Subject: [PATCH] Re-visit the xkbcommon dependency QtGui doesn't expose xkbcommon as public dependency anymore. QtGuiPrivate, however does now, but only in the CMake build. Fix the qmake build by adding an explicit xkbcommon dependency to client.pro, like it's done for the compositor. Commented out the explicit xkbcommon dependencies in the CMakeLists.txt files of client and compositor. Mark the XKB packages as optional, such that qtwayland can actually be built if the feature xkbcommon is OFF and no libxkbcommon-dev package is installed. Change-Id: Ia1c7a8333dc8a93b4924e03f7f2284a709a9d65b Reviewed-by: Alexandru Croitor --- src/plugins/platforms/wayland/.prev_CMakeLists.txt | 5 +++++ src/plugins/platforms/wayland/CMakeLists.txt | 10 ++++++++++ src/plugins/platforms/wayland/client.pro | 2 ++ src/plugins/platforms/wayland/configure.cmake | 2 +- 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/plugins/platforms/wayland/.prev_CMakeLists.txt b/src/plugins/platforms/wayland/.prev_CMakeLists.txt index 454b06ae38f..142a8a272aa 100644 --- a/src/plugins/platforms/wayland/.prev_CMakeLists.txt +++ b/src/plugins/platforms/wayland/.prev_CMakeLists.txt @@ -89,6 +89,11 @@ qt6_generate_wayland_protocol_client_sources(WaylandClient ## Scopes: ##################################################################### +qt_extend_target(WaylandClient CONDITION QT_FEATURE_xkbcommon + PUBLIC_LIBRARIES + XKB::XKB +) + qt_extend_target(WaylandClient CONDITION QT_FEATURE_clipboard SOURCES qwaylandclipboard.cpp qwaylandclipboard_p.h diff --git a/src/plugins/platforms/wayland/CMakeLists.txt b/src/plugins/platforms/wayland/CMakeLists.txt index 62bc7e09e9f..b72dbb36a41 100644 --- a/src/plugins/platforms/wayland/CMakeLists.txt +++ b/src/plugins/platforms/wayland/CMakeLists.txt @@ -89,6 +89,16 @@ qt6_generate_wayland_protocol_client_sources(WaylandClient ## Scopes: ##################################################################### +# special case begin +# +# Do not explicitly add XKB::XKB. This is already done by Qt::GuiPrivate. +# +# qt_extend_target(WaylandClient CONDITION QT_FEATURE_xkbcommon +# PUBLIC_LIBRARIES +# XKB::XKB +# ) +# special case end + qt_extend_target(WaylandClient CONDITION QT_FEATURE_clipboard SOURCES qwaylandclipboard.cpp qwaylandclipboard_p.h diff --git a/src/plugins/platforms/wayland/client.pro b/src/plugins/platforms/wayland/client.pro index da6a926dc48..5a071d9ed93 100644 --- a/src/plugins/platforms/wayland/client.pro +++ b/src/plugins/platforms/wayland/client.pro @@ -14,6 +14,8 @@ CONFIG -= precompile_header CONFIG += link_pkgconfig wayland-scanner QMAKE_USE += wayland-client +qtConfig(xkbcommon): \ + QMAKE_USE += xkbcommon INCLUDEPATH += $$PWD/../shared diff --git a/src/plugins/platforms/wayland/configure.cmake b/src/plugins/platforms/wayland/configure.cmake index 62da9940b0d..201f5d46290 100644 --- a/src/plugins/platforms/wayland/configure.cmake +++ b/src/plugins/platforms/wayland/configure.cmake @@ -26,7 +26,7 @@ if(NOT TARGET X11::X11) 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) + qt_find_package(XKB 0.5.0 PROVIDED_TARGETS XKB::XKB MODULE_NAME gui QMAKE_LIB xkbcommon MARK_OPTIONAL) endif() # special case end