From 728ad21b00e0636e6d24c93a7edcd05fba0aead0 Mon Sep 17 00:00:00 2001
From: Andrew Udvare <audvare@gmail.com>
Date: Tue, 23 Dec 2025 02:01:43 -0500
Subject: [PATCH 15/15] rpcs3qt: force include path for qpa private header for
 Wayland

---
 rpcs3/rpcs3qt/CMakeLists.txt | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/rpcs3/rpcs3qt/CMakeLists.txt b/rpcs3/rpcs3qt/CMakeLists.txt
index 7f7605cb7..6336825f9 100644
--- a/rpcs3/rpcs3qt/CMakeLists.txt
+++ b/rpcs3/rpcs3qt/CMakeLists.txt
@@ -188,6 +188,16 @@ set_target_properties(rpcs3_ui
 # https://docs.microsoft.com/en-us/windows/win32/winprog/using-the-windows-headers#faster-builds-with-smaller-header-files
 target_compile_definitions(rpcs3_ui PRIVATE WIN32_LEAN_AND_MEAN)
 
+file(GLOB _qplatformnativeinterface_h_list /usr/include/qt6/QtGui/*/QtGui/qpa/qplatformnativeinterface.h)
+list(LENGTH _qplatformnativeinterface_h_list _qplatformnativeinterface_h_list_length)
+if (_qplatformnativeinterface_h_list_length EQUAL 0)
+  message(FATAL_ERROR "Did not find qplatformnativeinterface.h file.")
+endif()
+list(GET _qplatformnativeinterface_h_list 0 _qplatformnativeinterface_h_path)
+cmake_path(GET _qplatformnativeinterface_h_path PARENT_PATH _qplatformnativeinterface_h_parent_path)
+cmake_path(GET _qplatformnativeinterface_h_parent_path PARENT_PATH _qplatformnativeinterface_h_parent_parent_path)
+target_include_directories(rpcs3_ui PUBLIC ${_qplatformnativeinterface_h_parent_parent_path})
+
 target_link_libraries(rpcs3_ui
     PUBLIC
         rpcs3_emu
-- 
2.52.0

