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

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