From 3785caf55f33f2df7bb3180e774f953cd40d06cb Mon Sep 17 00:00:00 2001 From: Mike Lothian Date: Thu, 23 Oct 2025 18:03:21 +0100 Subject: [PATCH] CMakeLists: Fix build with Qt6.10 --- CMakeLists.txt | 5 +++++ src/yuzu/CMakeLists.txt | 3 +++ 2 files changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a9e489ba0d..768c9cea69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) diff --git a/src/yuzu/CMakeLists.txt b/src/yuzu/CMakeLists.txt index a1a7f0f60d..70f408e504 100644 --- a/src/yuzu/CMakeLists.txt +++ b/src/yuzu/CMakeLists.txt @@ -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