1
0
Fork 0

build/wayland: do not link to a target in wl_proto

This commit is contained in:
outfoxxed 2025-01-11 23:59:19 -08:00
parent 2c411fce5a
commit 918dd2392d
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
7 changed files with 27 additions and 34 deletions
src/wayland
CMakeLists.txt
hyprland
focus_grab
global_shortcuts
surface
session_lock
toplevel_management
wlr_layershell

View file

@ -28,7 +28,7 @@ qs_add_pchset(wayland-protocol
<qstring.h>
)
function (wl_proto target name path)
function (wl_proto target name dir)
set(PROTO_BUILD_PATH ${CMAKE_CURRENT_BINARY_DIR}/wl-proto/${name})
make_directory(${PROTO_BUILD_PATH})
@ -36,39 +36,38 @@ function (wl_proto target name path)
set(WS_CLIENT_CODE "${PROTO_BUILD_PATH}/wayland-${name}.c")
set(QWS_CLIENT_HEADER "${PROTO_BUILD_PATH}/qwayland-${name}.h")
set(QWS_CLIENT_CODE "${PROTO_BUILD_PATH}/qwayland-${name}.cpp")
set(PATH "${dir}/${name}.xml")
add_custom_command(
OUTPUT "${WS_CLIENT_HEADER}"
COMMAND Wayland::Scanner client-header "${path}" "${WS_CLIENT_HEADER}"
DEPENDS Wayland::Scanner "${path}"
COMMAND Wayland::Scanner client-header "${PATH}" "${WS_CLIENT_HEADER}"
DEPENDS Wayland::Scanner "${PATH}"
)
add_custom_command(
OUTPUT "${WS_CLIENT_CODE}"
COMMAND Wayland::Scanner private-code "${path}" "${WS_CLIENT_CODE}"
DEPENDS Wayland::Scanner "${path}"
COMMAND Wayland::Scanner private-code "${PATH}" "${WS_CLIENT_CODE}"
DEPENDS Wayland::Scanner "${PATH}"
)
add_custom_command(
OUTPUT "${QWS_CLIENT_HEADER}"
COMMAND Qt6::qtwaylandscanner client-header "${path}" > "${QWS_CLIENT_HEADER}"
DEPENDS Qt6::qtwaylandscanner "${path}"
COMMAND Qt6::qtwaylandscanner client-header "${PATH}" > "${QWS_CLIENT_HEADER}"
DEPENDS Qt6::qtwaylandscanner "${PATH}"
)
add_custom_command(
OUTPUT "${QWS_CLIENT_CODE}"
COMMAND Qt6::qtwaylandscanner client-code "${path}" > "${QWS_CLIENT_CODE}"
DEPENDS Qt6::qtwaylandscanner "${path}"
COMMAND Qt6::qtwaylandscanner client-code "${PATH}" > "${QWS_CLIENT_CODE}"
DEPENDS Qt6::qtwaylandscanner "${PATH}"
)
add_library(wl-proto-${name}-wl STATIC ${WS_CLIENT_HEADER} ${WS_CLIENT_CODE})
add_library(wl-proto-${name} STATIC ${QWS_CLIENT_HEADER} ${QWS_CLIENT_CODE})
add_library(${target} STATIC ${QWS_CLIENT_HEADER} ${QWS_CLIENT_CODE})
target_include_directories(wl-proto-${name} INTERFACE ${PROTO_BUILD_PATH})
target_link_libraries(wl-proto-${name} wl-proto-${name}-wl Qt6::WaylandClient Qt6::WaylandClientPrivate)
qs_pch(wl-proto-${name} SET wayland-protocol)
target_link_libraries(${target} PRIVATE wl-proto-${name})
target_include_directories(${target} INTERFACE ${PROTO_BUILD_PATH})
target_link_libraries(${target} wl-proto-${name}-wl Qt6::WaylandClient Qt6::WaylandClientPrivate)
qs_pch(${target} SET wayland-protocol)
endfunction()
# -----

View file

@ -14,13 +14,11 @@ qs_add_module_deps_light(quickshell-hyprland-focus-grab Quickshell)
install_qml_module(quickshell-hyprland-focus-grab)
wl_proto(quickshell-hyprland-focus-grab
hyprland-focus-grab-v1
"${CMAKE_CURRENT_SOURCE_DIR}/hyprland-focus-grab-v1.xml"
)
wl_proto(wlp-hyprland-focus-grab hyprland-focus-grab-v1 "${CMAKE_CURRENT_SOURCE_DIR}")
target_link_libraries(quickshell-hyprland-focus-grab PRIVATE
Qt::Quick Qt::WaylandClient Qt::WaylandClientPrivate wayland-client
wlp-hyprland-focus-grab
)
qs_module_pch(quickshell-hyprland-focus-grab SET large)

View file

@ -12,14 +12,12 @@ qt_add_qml_module(quickshell-hyprland-global-shortcuts
install_qml_module(quickshell-hyprland-global-shortcuts)
wl_proto(quickshell-hyprland-global-shortcuts
hyprland-global-shortcuts-v1
"${CMAKE_CURRENT_SOURCE_DIR}/hyprland-global-shortcuts-v1.xml"
)
wl_proto(wlp-hyprland-shortcuts hyprland-global-shortcuts-v1 "${CMAKE_CURRENT_SOURCE_DIR}")
target_link_libraries(quickshell-hyprland-global-shortcuts PRIVATE
Qt::Qml Qt::WaylandClient Qt::WaylandClientPrivate wayland-client
Qt::Quick # pch
wlp-hyprland-shortcuts
)
qs_module_pch(quickshell-hyprland-global-shortcuts)

View file

@ -12,13 +12,11 @@ qt_add_qml_module(quickshell-hyprland-surface-extensions
install_qml_module(quickshell-hyprland-surface-extensions)
wl_proto(quickshell-hyprland-surface-extensions
hyprland-surface-v1
"${CMAKE_CURRENT_SOURCE_DIR}/hyprland-surface-v1.xml"
)
wl_proto(wlp-hyprland-surface hyprland-surface-v1 "${CMAKE_CURRENT_SOURCE_DIR}")
target_link_libraries(quickshell-hyprland-surface-extensions PRIVATE
Qt::Quick Qt::WaylandClient Qt::WaylandClientPrivate wayland-client
wlp-hyprland-surface
)
qs_module_pch(quickshell-hyprland-surface-extensions)

View file

@ -6,10 +6,11 @@ qt_add_library(quickshell-wayland-sessionlock STATIC
session_lock.cpp
)
wl_proto(quickshell-wayland-sessionlock ext-session-lock-v1 "${WAYLAND_PROTOCOLS}/staging/ext-session-lock/ext-session-lock-v1.xml")
wl_proto(wlp-session-lock ext-session-lock-v1 "${WAYLAND_PROTOCOLS}/staging/ext-session-lock")
target_link_libraries(quickshell-wayland-sessionlock PRIVATE
Qt::Quick Qt::WaylandClient Qt::WaylandClientPrivate wayland-client
wlp-session-lock
)
qs_pch(quickshell-wayland-sessionlock SET large)

View file

@ -16,13 +16,11 @@ qs_add_module_deps_light(quickshell-wayland-toplevel-management
install_qml_module(quickshell-wayland-toplevel-management)
wl_proto(quickshell-wayland-toplevel-management
wlr-foreign-toplevel-management-unstable-v1
"${CMAKE_CURRENT_SOURCE_DIR}/wlr-foreign-toplevel-management-unstable-v1.xml"
)
wl_proto(wlp-foreign-toplevel wlr-foreign-toplevel-management-unstable-v1 "${CMAKE_CURRENT_SOURCE_DIR}")
target_link_libraries(quickshell-wayland-toplevel-management PRIVATE
Qt::Quick Qt::WaylandClient Qt::WaylandClientPrivate wayland-client
wlp-foreign-toplevel
)
qs_module_pch(quickshell-wayland-toplevel-management SET large)

View file

@ -14,13 +14,14 @@ qs_add_module_deps_light(quickshell-wayland-layershell Quickshell Quickshell.Way
install_qml_module(quickshell-wayland-layershell)
wl_proto(quickshell-wayland-layershell wlr-layer-shell-unstable-v1 "${CMAKE_CURRENT_SOURCE_DIR}/wlr-layer-shell-unstable-v1.xml")
wl_proto(wlp-layer-shell wlr-layer-shell-unstable-v1 "${CMAKE_CURRENT_SOURCE_DIR}")
# link dependency of wlr-layer-shell's codegen
wl_proto(quickshell-wayland-layershell xdg-shell "${WAYLAND_PROTOCOLS}/stable/xdg-shell/xdg-shell.xml")
wl_proto(wlp-xdg-shell xdg-shell "${WAYLAND_PROTOCOLS}/stable/xdg-shell")
target_link_libraries(quickshell-wayland-layershell PRIVATE
Qt::Quick Qt::WaylandClient Qt::WaylandClientPrivate wayland-client
wlp-layer-shell wlp-xdg-shell
)
qs_module_pch(quickshell-wayland-layershell SET large)