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 <alexandru.croitor@qt.io>
This commit is contained in:
Joerg Bornemann 2020-09-22 12:29:17 +02:00
parent 769bef69c8
commit f1b5619ca0
4 changed files with 18 additions and 1 deletions

View File

@ -89,6 +89,11 @@ qt6_generate_wayland_protocol_client_sources(WaylandClient
## Scopes: ## Scopes:
##################################################################### #####################################################################
qt_extend_target(WaylandClient CONDITION QT_FEATURE_xkbcommon
PUBLIC_LIBRARIES
XKB::XKB
)
qt_extend_target(WaylandClient CONDITION QT_FEATURE_clipboard qt_extend_target(WaylandClient CONDITION QT_FEATURE_clipboard
SOURCES SOURCES
qwaylandclipboard.cpp qwaylandclipboard_p.h qwaylandclipboard.cpp qwaylandclipboard_p.h

View File

@ -89,6 +89,16 @@ qt6_generate_wayland_protocol_client_sources(WaylandClient
## Scopes: ## 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 qt_extend_target(WaylandClient CONDITION QT_FEATURE_clipboard
SOURCES SOURCES
qwaylandclipboard.cpp qwaylandclipboard_p.h qwaylandclipboard.cpp qwaylandclipboard_p.h

View File

@ -14,6 +14,8 @@ CONFIG -= precompile_header
CONFIG += link_pkgconfig wayland-scanner CONFIG += link_pkgconfig wayland-scanner
QMAKE_USE += wayland-client QMAKE_USE += wayland-client
qtConfig(xkbcommon): \
QMAKE_USE += xkbcommon
INCLUDEPATH += $$PWD/../shared INCLUDEPATH += $$PWD/../shared

View File

@ -26,7 +26,7 @@ if(NOT TARGET X11::X11)
endif() endif()
# Same for XKB. # Same for XKB.
if(NOT TARGET XKB::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() endif()
# special case end # special case end