From d4b19e4a30563e9ed0fcc761eccfcf1a479cae8c Mon Sep 17 00:00:00 2001 From: outfoxxed Date: Sun, 28 Sep 2025 18:55:45 -0700 Subject: [PATCH] build: fix cross compilation --- default.nix | 6 ++++-- src/wayland/CMakeLists.txt | 14 +++++++------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/default.nix b/default.nix index 71c949e..2cb3ac8 100644 --- a/default.nix +++ b/default.nix @@ -54,11 +54,13 @@ nativeBuildInputs = [ cmake ninja - qt6.qtshadertools spirv-tools pkg-config ] - ++ lib.optional withWayland wayland-scanner; + ++ lib.optionals withWayland [ + qt6.qtwayland # qtwaylandscanner required at build time + wayland-scanner + ]; buildInputs = [ qt6.qtbase diff --git a/src/wayland/CMakeLists.txt b/src/wayland/CMakeLists.txt index 1d6543e..b0ee3aa 100644 --- a/src/wayland/CMakeLists.txt +++ b/src/wayland/CMakeLists.txt @@ -1,6 +1,6 @@ find_package(PkgConfig REQUIRED) find_package(WaylandScanner REQUIRED) -pkg_check_modules(wayland REQUIRED IMPORTED_TARGET wayland-client wayland-protocols) +pkg_check_modules(wayland REQUIRED IMPORTED_TARGET wayland-client wayland-protocols>=1.41) # wayland protocols @@ -12,13 +12,13 @@ if(NOT TARGET Qt6::qtwaylandscanner) message(FATAL_ERROR "qtwaylandscanner executable not found. Most likely there is an issue with your Qt installation.") endif() -execute_process( - COMMAND pkg-config --variable=pkgdatadir wayland-protocols - OUTPUT_VARIABLE WAYLAND_PROTOCOLS - OUTPUT_STRIP_TRAILING_WHITESPACE -) +pkg_get_variable(WAYLAND_PROTOCOLS wayland-protocols pkgdatadir) -message(STATUS "Found wayland-protocols at ${WAYLAND_PROTOCOLS_DIR}") +if(WAYLAND_PROTOCOLS) + message(STATUS "Found wayland protocols at ${WAYLAND_PROTOCOLS}") +else() + message(FATAL_ERROR "Could not find wayland protocols") +endif() qs_add_pchset(wayland-protocol DEPENDENCIES Qt::Core Qt::WaylandClient Qt::WaylandClientPrivate