Blame SOURCES/0040-Use-proper-dependencies-in-compile-tests.patch

f38a11
From 118674630cdb5933e66a8b4415afe7c716ad4662 Mon Sep 17 00:00:00 2001
f38a11
From: Fabian Vogt <fabian@ritter-vogt.de>
f38a11
Date: Fri, 4 Feb 2022 11:07:36 +0100
f38a11
Subject: [PATCH 40/40] Use proper dependencies in compile tests
f38a11
f38a11
Use the dependencies as found by the "libraries" section instead of relying
f38a11
on them being available in the default location (e.g. "-ldrm").
f38a11
f38a11
Additionally, VK_USE_PLATFORM_WAYLAND_KHR requires <wayland-client.h>, so
f38a11
add the wayland-client dependency.
f38a11
f38a11
This fixes those tests if e.g. wayland-client headers need to be found through
f38a11
pkgconfig.
f38a11
f38a11
This part of the code changed completely in Qt 6, so this is a totally
f38a11
different patch and not a cherry-pick of 5fc2e1915c3a
f38a11
("CMake: Fix qtwayland feature detection").
f38a11
f38a11
Fixes: QTBUG-100475
f38a11
---
f38a11
 src/client/configure.json     |  8 ++++----
f38a11
 src/compositor/configure.json | 34 +++++++++++++++++++++++++++++-----
f38a11
 2 files changed, 33 insertions(+), 9 deletions(-)
f38a11
f38a11
diff --git a/src/client/configure.json b/src/client/configure.json
f38a11
index 2f424580..29222357 100644
f38a11
--- a/src/client/configure.json
f38a11
+++ b/src/client/configure.json
f38a11
@@ -149,8 +149,7 @@
f38a11
                     "#endif"
f38a11
                 ]
f38a11
             },
f38a11
-            "libs": "-ldrm",
f38a11
-            "use": "egl"
f38a11
+            "use": "drm egl"
f38a11
         },
f38a11
         "vulkan-server-buffer": {
f38a11
             "label": "Vulkan Buffer Sharing",
f38a11
@@ -168,7 +167,8 @@
f38a11
                     "exportAllocInfo.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR;",
f38a11
                     "return 0;"
f38a11
                 ]
f38a11
-            }
f38a11
+            },
f38a11
+            "use": "wayland-client"
f38a11
         },
f38a11
         "egl_1_5-wayland": {
f38a11
             "label": "EGL 1.5 with Wayland Platform",
f38a11
@@ -183,7 +183,7 @@
f38a11
                     "eglGetPlatformDisplay(EGL_PLATFORM_WAYLAND_EXT, (struct wl_display *)(nullptr), nullptr);"
f38a11
                 ]
f38a11
             },
f38a11
-            "use": "egl"
f38a11
+            "use": "egl wayland-client"
f38a11
         }
f38a11
     },
f38a11
 
f38a11
diff --git a/src/compositor/configure.json b/src/compositor/configure.json
f38a11
index bcfd5215..da95d07b 100644
f38a11
--- a/src/compositor/configure.json
f38a11
+++ b/src/compositor/configure.json
f38a11
@@ -7,6 +7,31 @@
f38a11
     "testDir": "../../config.tests",
f38a11
 
f38a11
     "libraries": {
f38a11
+        "wayland-client": {
f38a11
+            "label": "Wayland client library",
f38a11
+            "headers": "wayland-version.h",
f38a11
+            "test": {
f38a11
+                "main": [
f38a11
+                    "#if WAYLAND_VERSION_MAJOR < 1",
f38a11
+                    "# error Wayland 1.8.0 or higher required",
f38a11
+                    "#endif",
f38a11
+                    "#if WAYLAND_VERSION_MAJOR == 1",
f38a11
+                    "# if WAYLAND_VERSION_MINOR < 8",
f38a11
+                    "#  error Wayland 1.8.0 or higher required",
f38a11
+                    "# endif",
f38a11
+                    "# if WAYLAND_VERSION_MINOR == 8",
f38a11
+                    "#  if WAYLAND_VERSION_MICRO < 0",
f38a11
+                    "#   error Wayland 1.8.0 or higher required",
f38a11
+                    "#  endif",
f38a11
+                    "# endif",
f38a11
+                    "#endif"
f38a11
+                 ]
f38a11
+            },
f38a11
+            "sources": [
f38a11
+                { "type": "pkgConfig", "args": "wayland-client" },
f38a11
+                "-lwayland-client"
f38a11
+            ]
f38a11
+        },
f38a11
         "wayland-server": {
f38a11
             "label": "wayland-server",
f38a11
             "headers": "wayland-version.h",
f38a11
@@ -151,8 +176,7 @@
f38a11
                     "#endif"
f38a11
                 ]
f38a11
             },
f38a11
-            "libs": "-ldrm",
f38a11
-            "use": "egl"
f38a11
+            "use": "drm egl"
f38a11
         },
f38a11
         "dmabuf-client-buffer": {
f38a11
             "label": "Linux Client dma-buf Buffer Sharing",
f38a11
@@ -176,8 +200,7 @@
f38a11
                     "return 0;"
f38a11
                 ]
f38a11
             },
f38a11
-            "libs": "-ldrm",
f38a11
-            "use": "egl"
f38a11
+            "use": "drm egl"
f38a11
         },
f38a11
         "vulkan-server-buffer": {
f38a11
             "label": "Vulkan Buffer Sharing",
f38a11
@@ -195,7 +218,8 @@
f38a11
                     "exportAllocInfo.handleTypes = VK_EXTERNAL_MEMORY_HANDLE_TYPE_OPAQUE_FD_BIT_KHR;",
f38a11
                     "return 0;"
f38a11
                 ]
f38a11
-            }
f38a11
+            },
f38a11
+            "use": "wayland-client"
f38a11
         }
f38a11
     },
f38a11
 
f38a11
-- 
f38a11
2.35.1
f38a11