Generate wayland code with PRIVATE_CODE

This commit is contained in:
David Redondo 2024-08-14 10:46:19 +02:00 committed by Xaver Hugl
parent fe5db7f97d
commit 9e2326d3ac
4 changed files with 75 additions and 24 deletions

View file

@ -2,12 +2,17 @@ add_subdirectory(helper)
add_library(KWinIntegrationTestFramework STATIC) add_library(KWinIntegrationTestFramework STATIC)
if (Qt6_VERSION VERSION_GREATER_EQUAL "6.8.0")
set(private_code_option "PRIVATE_CODE")
endif()
qt6_generate_wayland_protocol_client_sources(KWinIntegrationTestFramework qt6_generate_wayland_protocol_client_sources(KWinIntegrationTestFramework
${private_code_option}
NO_INCLUDE_CORE_ONLY NO_INCLUDE_CORE_ONLY
FILES FILES
${WaylandProtocols_DATADIR}/unstable/input-method/input-method-unstable-v1.xml ${WaylandProtocols_DATADIR}/unstable/input-method/input-method-unstable-v1.xml
) )
qt6_generate_wayland_protocol_client_sources(KWinIntegrationTestFramework qt6_generate_wayland_protocol_client_sources(KWinIntegrationTestFramework
${private_code_option}
FILES FILES
${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v3.xml ${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v3.xml
${CMAKE_SOURCE_DIR}/src/wayland/protocols/wlr-layer-shell-unstable-v1.xml ${CMAKE_SOURCE_DIR}/src/wayland/protocols/wlr-layer-shell-unstable-v1.xml

View file

@ -1,3 +1,6 @@
if (Qt6_VERSION VERSION_GREATER_EQUAL "6.8.0")
set(private_code_option "PRIVATE_CODE")
endif()
######################################################## ########################################################
# Test WaylandOutput # Test WaylandOutput
######################################################## ########################################################
@ -29,8 +32,11 @@ add_executable(testWaylandSeat)
set( testWaylandSeat_SRCS set( testWaylandSeat_SRCS
test_wayland_seat.cpp test_wayland_seat.cpp
) )
qt6_generate_wayland_protocol_client_sources(testWaylandSeat FILES qt6_generate_wayland_protocol_client_sources(testWaylandSeat
${WaylandProtocols_DATADIR}/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml) ${private_code_option}
FILES
${WaylandProtocols_DATADIR}/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml
)
target_sources(testWaylandSeat PRIVATE ${testWaylandSeat_SRCS}) target_sources(testWaylandSeat PRIVATE ${testWaylandSeat_SRCS})
target_link_libraries( testWaylandSeat Qt::Test Qt::Gui Plasma::KWaylandClient kwin Wayland::Client Wayland::Server) target_link_libraries( testWaylandSeat Qt::Test Qt::Gui Plasma::KWaylandClient kwin Wayland::Client Wayland::Server)
add_test(NAME kwayland-testWaylandSeat COMMAND testWaylandSeat) add_test(NAME kwayland-testWaylandSeat COMMAND testWaylandSeat)
@ -131,8 +137,11 @@ set( testServerSideDecoration_SRCS
test_server_side_decoration.cpp test_server_side_decoration.cpp
) )
add_executable(testServerSideDecoration ${testServerSideDecoration_SRCS}) add_executable(testServerSideDecoration ${testServerSideDecoration_SRCS})
qt6_generate_wayland_protocol_client_sources(testServerSideDecoration FILES qt6_generate_wayland_protocol_client_sources(testServerSideDecoration
${PLASMA_WAYLAND_PROTOCOLS_DIR}/server-decoration.xml) ${private_code_option}
FILES
${PLASMA_WAYLAND_PROTOCOLS_DIR}/server-decoration.xml
)
target_link_libraries( testServerSideDecoration Qt::Test Qt::Gui Plasma::KWaylandClient kwin Wayland::Client) target_link_libraries( testServerSideDecoration Qt::Test Qt::Gui Plasma::KWaylandClient kwin Wayland::Client)
add_test(NAME kwayland-testServerSideDecoration COMMAND testServerSideDecoration) add_test(NAME kwayland-testServerSideDecoration COMMAND testServerSideDecoration)
ecm_mark_as_test(testServerSideDecoration) ecm_mark_as_test(testServerSideDecoration)
@ -264,8 +273,11 @@ set( testServerSideDecorationPalette_SRCS
test_server_side_decoration_palette.cpp test_server_side_decoration_palette.cpp
) )
add_executable(testServerSideDecorationPalette ${testServerSideDecorationPalette_SRCS}) add_executable(testServerSideDecorationPalette ${testServerSideDecorationPalette_SRCS})
qt6_generate_wayland_protocol_client_sources(testServerSideDecorationPalette FILES qt6_generate_wayland_protocol_client_sources(testServerSideDecorationPalette
${PLASMA_WAYLAND_PROTOCOLS_DIR}/server-decoration-palette.xml) ${private_code_option}
FILES
${PLASMA_WAYLAND_PROTOCOLS_DIR}/server-decoration-palette.xml
)
target_link_libraries( testServerSideDecorationPalette Qt::Test Qt::Gui Plasma::KWaylandClient Wayland::Client kwin) target_link_libraries( testServerSideDecorationPalette Qt::Test Qt::Gui Plasma::KWaylandClient Wayland::Client kwin)
add_test(NAME kwayland-testServerSideDecorationPalette COMMAND testServerSideDecorationPalette) add_test(NAME kwayland-testServerSideDecorationPalette COMMAND testServerSideDecorationPalette)
ecm_mark_as_test(testServerSideDecorationPalette) ecm_mark_as_test(testServerSideDecorationPalette)

View file

@ -1,3 +1,6 @@
if (Qt6_VERSION VERSION_GREATER_EQUAL "6.8.0")
set(private_code_option "PRIVATE_CODE")
endif()
######################################################## ########################################################
# Test WaylandServerDisplay # Test WaylandServerDisplay
######################################################## ########################################################
@ -32,8 +35,11 @@ ecm_mark_as_test(testNoXdgRuntimeDir)
# Test Tablet Interface # Test Tablet Interface
######################################################## ########################################################
add_executable(testTabletInterface) add_executable(testTabletInterface)
qt6_generate_wayland_protocol_client_sources(testTabletInterface FILES qt6_generate_wayland_protocol_client_sources(testTabletInterface
${WaylandProtocols_DATADIR}/unstable/tablet/tablet-unstable-v2.xml) ${private_code_option}
FILES
${WaylandProtocols_DATADIR}/unstable/tablet/tablet-unstable-v2.xml
)
target_sources(testTabletInterface PRIVATE test_tablet_interface.cpp ${TABLET_SRCS}) target_sources(testTabletInterface PRIVATE test_tablet_interface.cpp ${TABLET_SRCS})
target_link_libraries( testTabletInterface Qt::Test kwin Plasma::KWaylandClient Wayland::Client) target_link_libraries( testTabletInterface Qt::Test kwin Plasma::KWaylandClient Wayland::Client)
add_test(NAME kwayland-testTabletInterface COMMAND testTabletInterface) add_test(NAME kwayland-testTabletInterface COMMAND testTabletInterface)
@ -43,8 +49,11 @@ ecm_mark_as_test(testTabletInterface)
# Test DataControlInterface # Test DataControlInterface
######################################################## ########################################################
add_executable(testDataControlInterface test_datacontrol_interface.cpp ${DATACONTROL_SRCS}) add_executable(testDataControlInterface test_datacontrol_interface.cpp ${DATACONTROL_SRCS})
qt6_generate_wayland_protocol_client_sources(testDataControlInterface FILES qt6_generate_wayland_protocol_client_sources(testDataControlInterface
${PROJECT_SOURCE_DIR}/src/wayland/protocols/wlr-data-control-unstable-v1.xml) ${private_code_option}
FILES
${PROJECT_SOURCE_DIR}/src/wayland/protocols/wlr-data-control-unstable-v1.xml
)
target_sources(testDataControlInterface PRIVATE test_datacontrol_interface.cpp ${DATACONTROL_SRCS}) target_sources(testDataControlInterface PRIVATE test_datacontrol_interface.cpp ${DATACONTROL_SRCS})
target_link_libraries( testDataControlInterface Qt::Test kwin Plasma::KWaylandClient Wayland::Client) target_link_libraries( testDataControlInterface Qt::Test kwin Plasma::KWaylandClient Wayland::Client)
add_test(NAME kwayland-testDataControlInterface COMMAND testDataControlInterface) add_test(NAME kwayland-testDataControlInterface COMMAND testDataControlInterface)
@ -54,8 +63,11 @@ ecm_mark_as_test(testDataControlInterface)
# Test Keyboard Shortcuts Inhibitor Interface # Test Keyboard Shortcuts Inhibitor Interface
######################################################## ########################################################
add_executable(testKeyboardShortcutsInhibitorInterface) add_executable(testKeyboardShortcutsInhibitorInterface)
qt6_generate_wayland_protocol_client_sources(testKeyboardShortcutsInhibitorInterface FILES qt6_generate_wayland_protocol_client_sources(testKeyboardShortcutsInhibitorInterface
${WaylandProtocols_DATADIR}/unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts-inhibit-unstable-v1.xml) ${private_code_option}
FILES
${WaylandProtocols_DATADIR}/unstable/keyboard-shortcuts-inhibit/keyboard-shortcuts-inhibit-unstable-v1.xml
)
target_sources(testKeyboardShortcutsInhibitorInterface PRIVATE test_keyboard_shortcuts_inhibitor_interface.cpp ${KEYBOARD_SHORTCUTS_INHIBITOR_SRCS}) target_sources(testKeyboardShortcutsInhibitorInterface PRIVATE test_keyboard_shortcuts_inhibitor_interface.cpp ${KEYBOARD_SHORTCUTS_INHIBITOR_SRCS})
target_link_libraries(testKeyboardShortcutsInhibitorInterface Qt::Test kwin Plasma::KWaylandClient Wayland::Client) target_link_libraries(testKeyboardShortcutsInhibitorInterface Qt::Test kwin Plasma::KWaylandClient Wayland::Client)
add_test(NAME kwayland-testKeyboardShortcutsInhibitorInterface COMMAND testKeyboardShortcutsInhibitorInterface) add_test(NAME kwayland-testKeyboardShortcutsInhibitorInterface COMMAND testKeyboardShortcutsInhibitorInterface)
@ -65,8 +77,11 @@ ecm_mark_as_test(testKeyboardShortcutsInhibitorInterface)
# Test Viewporter Interface # Test Viewporter Interface
######################################################## ########################################################
add_executable(testViewporterInterface) add_executable(testViewporterInterface)
qt6_generate_wayland_protocol_client_sources(testViewporterInterface FILES qt6_generate_wayland_protocol_client_sources(testViewporterInterface
${WaylandProtocols_DATADIR}/stable/viewporter/viewporter.xml) ${private_code_option}
FILES
${WaylandProtocols_DATADIR}/stable/viewporter/viewporter.xml
)
target_sources(testViewporterInterface PRIVATE test_viewporter_interface.cpp ${VIEWPORTER_SRCS}) target_sources(testViewporterInterface PRIVATE test_viewporter_interface.cpp ${VIEWPORTER_SRCS})
target_link_libraries(testViewporterInterface Qt::Test kwin Plasma::KWaylandClient Wayland::Client) target_link_libraries(testViewporterInterface Qt::Test kwin Plasma::KWaylandClient Wayland::Client)
add_test(NAME kwayland-testViewporterInterface COMMAND testViewporterInterface) add_test(NAME kwayland-testViewporterInterface COMMAND testViewporterInterface)
@ -76,8 +91,11 @@ ecm_mark_as_test(testViewporterInterface)
# Test ScreencastV1Interface # Test ScreencastV1Interface
######################################################## ########################################################
add_executable(testScreencastV1Interface) add_executable(testScreencastV1Interface)
qt6_generate_wayland_protocol_client_sources(testScreencastV1Interface FILES qt6_generate_wayland_protocol_client_sources(testScreencastV1Interface
${PLASMA_WAYLAND_PROTOCOLS_DIR}/zkde-screencast-unstable-v1.xml) ${private_code_option}
FILES
${PLASMA_WAYLAND_PROTOCOLS_DIR}/zkde-screencast-unstable-v1.xml
)
target_sources(testScreencastV1Interface PRIVATE test_screencast.cpp ${SCREENCAST_SRCS}) target_sources(testScreencastV1Interface PRIVATE test_screencast.cpp ${SCREENCAST_SRCS})
target_link_libraries(testScreencastV1Interface Qt::Test kwin Wayland::Client Plasma::KWaylandClient) target_link_libraries(testScreencastV1Interface Qt::Test kwin Wayland::Client Plasma::KWaylandClient)
add_test(NAME kwayland-testScreencastV1Interface COMMAND testScreencastV1Interface) add_test(NAME kwayland-testScreencastV1Interface COMMAND testScreencastV1Interface)
@ -91,6 +109,7 @@ qt6_generate_wayland_protocol_client_sources(testInputMethodInterface
NO_INCLUDE_CORE_ONLY NO_INCLUDE_CORE_ONLY
FILES FILES
${WaylandProtocols_DATADIR}/unstable/input-method/input-method-unstable-v1.xml ${WaylandProtocols_DATADIR}/unstable/input-method/input-method-unstable-v1.xml
${private_code_option}
) )
target_sources(testInputMethodInterface PRIVATE target_sources(testInputMethodInterface PRIVATE
test_inputmethod_interface.cpp test_inputmethod_interface.cpp
@ -105,7 +124,9 @@ ecm_mark_as_test(testInputMethodInterface)
# Test LayerShellV1 Interface # Test LayerShellV1 Interface
######################################################## ########################################################
add_executable(testLayerShellV1Interface) add_executable(testLayerShellV1Interface)
qt6_generate_wayland_protocol_client_sources(testLayerShellV1Interface FILES qt6_generate_wayland_protocol_client_sources(testLayerShellV1Interface
${private_code_option}
FILES
${PROJECT_SOURCE_DIR}/src/wayland/protocols/wlr-layer-shell-unstable-v1.xml ${PROJECT_SOURCE_DIR}/src/wayland/protocols/wlr-layer-shell-unstable-v1.xml
${WaylandProtocols_DATADIR}/stable/xdg-shell/xdg-shell.xml ${WaylandProtocols_DATADIR}/stable/xdg-shell/xdg-shell.xml
) )
@ -119,8 +140,11 @@ ecm_mark_as_test(testLayerShellV1Interface)
# Test TextInputV3 Interface # Test TextInputV3 Interface
######################################################## ########################################################
add_executable(testTextInputV3Interface) add_executable(testTextInputV3Interface)
qt6_generate_wayland_protocol_client_sources(testTextInputV3Interface FILES qt6_generate_wayland_protocol_client_sources(testTextInputV3Interface
${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v3.xml) ${private_code_option}
FILES
${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v3.xml
)
target_sources(testTextInputV3Interface PRIVATE test_textinputv3_interface.cpp ${TEXTINPUTV3_SRCS}) target_sources(testTextInputV3Interface PRIVATE test_textinputv3_interface.cpp ${TEXTINPUTV3_SRCS})
target_link_libraries(testTextInputV3Interface Qt::Test kwin Plasma::KWaylandClient Wayland::Client) target_link_libraries(testTextInputV3Interface Qt::Test kwin Plasma::KWaylandClient Wayland::Client)
add_test(NAME kwayland-testTextInputV3Interface COMMAND testTextInputV3Interface) add_test(NAME kwayland-testTextInputV3Interface COMMAND testTextInputV3Interface)
@ -130,8 +154,11 @@ ecm_mark_as_test(testTextInputV3Interface)
# Test TextInputV1 Interface # Test TextInputV1 Interface
######################################################## ########################################################
add_executable(testTextInputV1Interface) add_executable(testTextInputV1Interface)
qt6_generate_wayland_protocol_client_sources(testTextInputV1Interface FILES qt6_generate_wayland_protocol_client_sources(testTextInputV1Interface
${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v1.xml) ${private_code_option}
FILES
${WaylandProtocols_DATADIR}/unstable/text-input/text-input-unstable-v1.xml
)
target_sources(testTextInputV1Interface PRIVATE test_textinputv1_interface.cpp ${TEXTINPUTV1_SRCS}) target_sources(testTextInputV1Interface PRIVATE test_textinputv1_interface.cpp ${TEXTINPUTV1_SRCS})
target_link_libraries(testTextInputV1Interface Qt::Test kwin Plasma::KWaylandClient Wayland::Client) target_link_libraries(testTextInputV1Interface Qt::Test kwin Plasma::KWaylandClient Wayland::Client)
add_test(NAME kwayland-testTextInputV1Interface COMMAND testTextInputV1Interface) add_test(NAME kwayland-testTextInputV1Interface COMMAND testTextInputV1Interface)

View file

@ -4,7 +4,14 @@ set(kwin_killer_helper_SRCS killer.cpp)
add_executable(kwin_killer_helper ${kwin_killer_helper_SRCS}) add_executable(kwin_killer_helper ${kwin_killer_helper_SRCS})
qt6_generate_wayland_protocol_client_sources(kwin_killer_helper FILES ${WaylandProtocols_DATADIR}/unstable/xdg-foreign/xdg-foreign-unstable-v2.xml) if (Qt6_VERSION VERSION_GREATER_EQUAL "6.8.0")
set(private_code_option "PRIVATE_CODE")
endif()
qt6_generate_wayland_protocol_client_sources(kwin_killer_helper
${private_code_option}
FILES
${WaylandProtocols_DATADIR}/unstable/xdg-foreign/xdg-foreign-unstable-v2.xml
)
target_link_libraries(kwin_killer_helper target_link_libraries(kwin_killer_helper
KF6::AuthCore KF6::AuthCore