CMakeLists: Fix build with Qt6.10

This commit is contained in:
Mike Lothian 2025-10-23 18:03:21 +01:00
parent ae235df7ee
commit 3785caf55f
2 changed files with 8 additions and 0 deletions

View File

@ -459,6 +459,11 @@ if (ENABLE_QT)
if (UNIX AND NOT APPLE)
find_package(Qt6 REQUIRED COMPONENTS DBus)
if (Qt6_VERSION VERSION_GREATER_EQUAL 6.10.0)
# GuiPrivate is needed to #include qplatformnativeinterface.h in MainWindow.cpp with Qt 6.10+.
set(NEED_QT_GUI_PRIVATE_COMPONENT ON)
find_package(Qt6 REQUIRED COMPONENTS GuiPrivate)
endif()
endif()
if (ENABLE_QT_TRANSLATION)

View File

@ -389,6 +389,9 @@ endif()
if (UNIX AND NOT APPLE)
target_link_libraries(yuzu PRIVATE Qt6::DBus)
endif()
if (NEED_QT_GUI_PRIVATE_COMPONENT)
target_link_libraries(yuzu PRIVATE Qt6::GuiPrivate)
endif()
target_compile_definitions(yuzu PRIVATE
# Use QStringBuilder for string concatenation to reduce