build: expose dependency metatypes in light dep

If not Qt will generate stubs for unknown types, which qmllint reads and
treats as the real type
This commit is contained in:
2 * r + 2 * t authored and outfoxxed committed 2026-10-16 22:20:46 -07:00
1 parent 95a1f91125
commit 2b4501a282
26 files changed
+56 -22

No files matched your search

+1
View File
@@ -5,3 +5,4 @@
- Fixed desktop entries being parsed incorrectly with trailing whitespace or CRLF line endings.
- Fixed `WlSessionLock.locked` changes not being emitted on unlock.
- Fixed a crash when unplugging a screen being captured by ScreencopyView or trying to capture the fallback screen.
- Fixed most broken qml types in qmlls/qmllint for Qt 6.12.
+21 -2
View File
@@ -21,8 +21,27 @@ endfunction()
# DEPENDENCIES introduces a cmake dependency which we don't need with static modules.
# This greatly improves comp speed by not introducing those dependencies.
function (qs_add_module_deps_light target)
foreach (dep IN LISTS ARGN)
string(APPEND qmldir_extra "depends ${dep}\n")
cmake_parse_arguments(PARSE_ARGV 1 arg "" "" "URIS")
set(uris)
# Add dep metatypes files to target so it picks up the dep type data
foreach (dep IN LISTS arg_UNPARSED_ARGUMENTS)
get_target_property(uri ${dep} QT_QML_MODULE_URI)
get_target_property(metatypes ${dep} INTERFACE_QT_META_TYPES_BUILD_FILE)
if (NOT uri OR NOT metatypes)
message(FATAL_ERROR "${dep} must be a qml module defined before ${target}")
endif()
list(APPEND uris ${uri})
target_sources(${target} PRIVATE ${metatypes})
endforeach()
list(APPEND uris ${arg_URIS})
foreach (uri IN LISTS uris)
string(APPEND qmldir_extra "depends ${uri}\n")
endforeach()
qs_append_qmldir(${target} "${qmldir_extra}")
+2
View File
@@ -29,6 +29,8 @@ qt_add_qml_module(quickshell-bluetooth
DEPENDENCIES QtQml
)
qs_add_module_deps_light(quickshell-bluetooth quickshell-core)
install_qml_module(quickshell-bluetooth)
# dbus headers
+1 -1
View File
@@ -20,7 +20,7 @@ qt_add_qml_module(quickshell-dbusmenu
DEPENDENCIES QtQml
)
qs_add_module_deps_light(quickshell-dbusmenu Quickshell)
qs_add_module_deps_light(quickshell-dbusmenu quickshell-core)
install_qml_module(quickshell-dbusmenu)
+1 -1
View File
@@ -21,7 +21,7 @@ qt_add_qml_module(quickshell-io
FileView.qml
)
qs_add_module_deps_light(quickshell-io Quickshell)
qs_add_module_deps_light(quickshell-io quickshell-core)
install_qml_module(quickshell-io)
target_link_libraries(quickshell-io PRIVATE Qt::Quick quickshell-ipc)
+1 -1
View File
@@ -19,7 +19,7 @@ qt_add_qml_module(quickshell-network
DEPENDENCIES QtQml
)
qs_add_module_deps_light(quickshell-network Quickshell)
qs_add_module_deps_light(quickshell-network quickshell-core)
install_qml_module(quickshell-network)
target_link_libraries(quickshell-network PRIVATE quickshell-network-nm Qt::Qml Qt::DBus)
qs_add_link_dependencies(quickshell-network quickshell-dbus)
+1 -1
View File
@@ -33,7 +33,7 @@ qt_add_qml_module(quickshell-service-mpris
DEPENDENCIES QtQml
)
qs_add_module_deps_light(quickshell-service-mpris Quickshell)
qs_add_module_deps_light(quickshell-service-mpris quickshell-core)
install_qml_module(quickshell-service-mpris)
+1 -1
View File
@@ -22,7 +22,7 @@ qt_add_qml_module(quickshell-service-notifications
VERSION 0.1
)
qs_add_module_deps_light(quickshell-service-notifications Quickshell)
qs_add_module_deps_light(quickshell-service-notifications quickshell-core)
install_qml_module(quickshell-service-notifications)
target_link_libraries(quickshell-service-notifications PRIVATE Qt::Quick Qt::DBus)
+1 -1
View File
@@ -20,7 +20,7 @@ qt_add_qml_module(quickshell-service-pipewire
DEPENDENCIES QtQml
)
qs_add_module_deps_light(quickshell-service-pipewire Quickshell)
qs_add_module_deps_light(quickshell-service-pipewire quickshell-core)
install_qml_module(quickshell-service-pipewire)
+1 -1
View File
@@ -44,7 +44,7 @@ qt_add_qml_module(quickshell-service-statusnotifier
DEPENDENCIES QtQml
)
qs_add_module_deps_light(quickshell-service-statusnotifier Quickshell Quickshell.DBusMenu)
qs_add_module_deps_light(quickshell-service-statusnotifier quickshell-core quickshell-dbusmenu)
install_qml_module(quickshell-service-statusnotifier)
+1 -1
View File
@@ -34,7 +34,7 @@ qt_add_qml_module(quickshell-service-upower
DEPENDENCIES QtQml
)
qs_add_module_deps_light(quickshell-service-upower Quickshell)
qs_add_module_deps_light(quickshell-service-upower quickshell-core)
install_qml_module(quickshell-service-upower)
+1 -1
View File
@@ -148,7 +148,7 @@ qt_add_qml_module(quickshell-wayland
IMPORTS ${WAYLAND_MODULES}
)
qs_add_module_deps_light(quickshell-wayland Quickshell)
qs_add_module_deps_light(quickshell-wayland quickshell-core)
install_qml_module(quickshell-wayland)
@@ -10,6 +10,8 @@ qt_add_qml_module(quickshell-wayland-background-effect
DEPENDENCIES QtQml
)
qs_add_module_deps_light(quickshell-wayland-background-effect quickshell-core)
install_qml_module(quickshell-wayland-background-effect)
wl_proto(wlp-background-effect ext-background-effect-v1 "${WAYLAND_PROTOCOLS}/staging/ext-background-effect")
+1 -1
View File
@@ -30,7 +30,7 @@ qt_add_qml_module(quickshell-hyprland
IMPORTS ${HYPRLAND_MODULES}
)
qs_add_module_deps_light(quickshell-io Quickshell)
qs_add_module_deps_light(quickshell-hyprland quickshell-core)
install_qml_module(quickshell-hyprland)
# intentionally no pch as the module is empty
@@ -10,7 +10,7 @@ qt_add_qml_module(quickshell-hyprland-focus-grab
DEPENDENCIES QtQml
)
qs_add_module_deps_light(quickshell-hyprland-focus-grab Quickshell)
qs_add_module_deps_light(quickshell-hyprland-focus-grab quickshell-core)
install_qml_module(quickshell-hyprland-focus-grab)
+3 -1
View File
@@ -11,13 +11,15 @@ qt_add_qml_module(quickshell-hyprland-ipc
DEPENDENCIES QtQuick
)
qs_add_module_deps_light(quickshell-hyprland-ipc Quickshell)
qs_add_module_deps_light(quickshell-hyprland-ipc quickshell-core)
install_qml_module(quickshell-hyprland-ipc)
target_link_libraries(quickshell-hyprland-ipc PRIVATE Qt::Quick quickshell-core)
if (WAYLAND_TOPLEVEL_MANAGEMENT)
qs_add_module_deps_light(quickshell-hyprland-ipc quickshell-wayland-toplevel-management)
target_sources(quickshell-hyprland-ipc PRIVATE
toplevel_mapping.cpp
hyprland_toplevel.cpp
@@ -10,6 +10,8 @@ qt_add_qml_module(quickshell-hyprland-surface-extensions
DEPENDENCIES QtQml
)
qs_add_module_deps_light(quickshell-hyprland-surface-extensions quickshell-core)
install_qml_module(quickshell-hyprland-surface-extensions)
wl_proto(wlp-hyprland-surface hyprland-surface-v1 "${CMAKE_CURRENT_SOURCE_DIR}")
+1 -1
View File
@@ -11,7 +11,7 @@ qt_add_qml_module(quickshell-wayland-idle-inhibit
install_qml_module(quickshell-wayland-idle-inhibit)
qs_add_module_deps_light(quickshell-wayland-idle-inhibit Quickshell)
qs_add_module_deps_light(quickshell-wayland-idle-inhibit quickshell-core)
wl_proto(wlp-idle-inhibit idle-inhibit-unstable-v1 "${WAYLAND_PROTOCOLS}/unstable/idle-inhibit")
+1 -1
View File
@@ -11,7 +11,7 @@ qt_add_qml_module(quickshell-wayland-idle-notify
install_qml_module(quickshell-wayland-idle-notify)
qs_add_module_deps_light(quickshell-wayland-idle-notify Quickshell)
qs_add_module_deps_light(quickshell-wayland-idle-notify quickshell-core)
wl_proto(wlp-idle-notify ext-idle-notify-v1 "${WAYLAND_PROTOCOLS}/staging/ext-idle-notify")
+1 -1
View File
@@ -11,7 +11,7 @@ qt_add_qml_module(quickshell-wayland-shortcuts-inhibit
install_qml_module(quickshell-wayland-shortcuts-inhibit)
qs_add_module_deps_light(quickshell-wayland-shortcuts-inhibit Quickshell)
qs_add_module_deps_light(quickshell-wayland-shortcuts-inhibit quickshell-core)
wl_proto(wlp-shortcuts-inhibit keyboard-shortcuts-inhibit-unstable-v1 "${WAYLAND_PROTOCOLS}/unstable/keyboard-shortcuts-inhibit")
+2 -1
View File
@@ -10,7 +10,8 @@ qt_add_qml_module(quickshell-wayland-toplevel-management
)
qs_add_module_deps_light(quickshell-wayland-toplevel-management
Quickshell Quickshell.Wayland
quickshell-core
URIS Quickshell.Wayland
)
install_qml_module(quickshell-wayland-toplevel-management)
+4 -1
View File
@@ -10,7 +10,10 @@ qt_add_qml_module(quickshell-wayland-layershell
DEPENDENCIES QtQuick
)
qs_add_module_deps_light(quickshell-wayland-layershell Quickshell Quickshell.Wayland)
qs_add_module_deps_light(quickshell-wayland-layershell
quickshell-core quickshell-window
URIS Quickshell.Wayland
)
install_qml_module(quickshell-wayland-layershell)
+1 -1
View File
@@ -12,7 +12,7 @@ qt_add_qml_module(quickshell-window
DEPENDENCIES QtQuick
)
qs_add_module_deps_light(quickshell-window Quickshell)
qs_add_module_deps_light(quickshell-window quickshell-core)
install_qml_module(quickshell-window)
+1 -1
View File
@@ -10,7 +10,7 @@ qt_add_qml_module(quickshell-windowmanager
DEPENDENCIES QtQuick
)
qs_add_module_deps_light(quickshell-windowmanager Quickshell)
qs_add_module_deps_light(quickshell-windowmanager quickshell-core)
install_qml_module(quickshell-windowmanager)
+2
View File
@@ -11,6 +11,8 @@ qt_add_qml_module(quickshell-x11
DEPENDENCIES QtQuick
)
qs_add_module_deps_light(quickshell-x11 quickshell-core quickshell-window)
install_qml_module(quickshell-x11)
add_library(quickshell-x11-init OBJECT init.cpp)
+1 -1
View File
@@ -13,7 +13,7 @@ qt_add_qml_module(quickshell-i3-ipc
DEPENDENCIES QtQml
)
qs_add_module_deps_light(quickshell-i3-ipc Quickshell)
qs_add_module_deps_light(quickshell-i3-ipc quickshell-core)
install_qml_module(quickshell-i3-ipc)