From 2be168524e0ae573399ae773edc20843db40c39a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hegyi=20L=C3=A1szl=C3=B3?= Date: Thu, 25 Sep 2025 01:56:31 +0200 Subject: [PATCH] Fix imgui not building on distros which don't have wayland headers on the default include path on Linux --- CMakeLists.txt | 1 + src/ngscopeclient/CMakeLists.txt | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 11bc21f7f..20f27a1df 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -163,6 +163,7 @@ endif() # We still use gtk on Linux for the file browser dialog in "native" mode) if(LINUX) pkg_check_modules(GTK QUIET IMPORTED_TARGET REQUIRED gtk+-3.0) + pkg_search_module(WAYLAND_CLIENT wayland-client IMPORTED_TARGET GLOBAL REQUIRED) endif() #WORKAROUND Fedora 38 does not include Threads from the glslang .cmake file, fixed in Fedora 39+ diff --git a/src/ngscopeclient/CMakeLists.txt b/src/ngscopeclient/CMakeLists.txt index 26b058204..2cdccd07b 100644 --- a/src/ngscopeclient/CMakeLists.txt +++ b/src/ngscopeclient/CMakeLists.txt @@ -196,6 +196,10 @@ target_include_directories(ngscopeclient #Linker settings if(LINUX) set(PLATFORM_LIBS X11) + if(${WAYLAND_CLIENT_FOUND}) + list(APPEND PLATFORM_LIBS ${WAYLAND_CLIENT_MODULE_NAME}) + target_include_directories(ngscopeclient SYSTEM PRIVATE ${WAYLAND_CLIENT_INCLUDE_DIRS}) + endif () else() set(PLATFORM_LIBS "") endif()