Skip to content

Commit 6092b37

Browse files
committed
build: explicitly depend on private qt modules
In Qt 6.10, private Qt modules must be depended on explicitly.
1 parent 1d94144 commit 6092b37

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

CMakeLists.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ if (NOT CMAKE_BUILD_TYPE)
100100
endif()
101101

102102
set(QT_FPDEPS Gui Qml Quick QuickControls2 Widgets ShaderTools)
103+
set(QT_PRIVDEPS QuickPrivate)
103104

104105
include(cmake/pch.cmake)
105106

@@ -115,6 +116,7 @@ endif()
115116

116117
if (WAYLAND)
117118
list(APPEND QT_FPDEPS WaylandClient)
119+
list(APPEND QT_PRIVDEPS WaylandClientPrivate)
118120
endif()
119121

120122
if (SERVICE_STATUS_NOTIFIER OR SERVICE_MPRIS OR SERVICE_UPOWER OR SERVICE_NOTIFICATIONS OR BLUETOOTH)
@@ -127,6 +129,13 @@ endif()
127129

128130
find_package(Qt6 REQUIRED COMPONENTS ${QT_FPDEPS})
129131

132+
# In Qt 6.10, private dependencies are required to be explicit,
133+
# but they could not be explicitly depended on prior to 6.9.
134+
if (Qt6_VERSION VERSION_GREATER_EQUAL "6.9.0")
135+
set(QT_NO_PRIVATE_MODULE_WARNING ON)
136+
find_package(Qt6 REQUIRED COMPONENTS ${QT_PRIVDEPS})
137+
endif()
138+
130139
set(CMAKE_AUTOUIC OFF)
131140
qt_standard_project_setup(REQUIRES 6.6)
132141
set(QT_QML_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/qml_modules)

0 commit comments

Comments
 (0)