summaryrefslogtreecommitdiffstats
path: root/meta/recipes-core/systemd/systemd/0001-meson-use-partial_dependency-to-get-include-director.patch
blob: 51ee5d8623d8400ad9eda8b1ac90e072c2db6d4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
From 260e871fda979f040c94d2011545e8122bed68ca Mon Sep 17 00:00:00 2001
From: Alexander Kanavin <alex@linutronix.de>
Date: Mon, 18 Oct 2021 10:13:07 +0200
Subject: [PATCH] meson: use partial_dependency() to get include directory

Getting the variable directly from pkg-config is prone to host
contamination when building in sysroots as the
compiler starts looking for the headers on the host in addition to
the sysroot.

Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/21027]
Signed-off-by: Alexander Kanavin <alex@linutronix.de>
---
 meson.build | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/meson.build b/meson.build
index df53c6156d..38fb37dd75 100644
--- a/meson.build
+++ b/meson.build
@@ -2618,18 +2618,17 @@ endif
 
 if conf.get('ENABLE_LOCALED') == 1
         if conf.get('HAVE_XKBCOMMON') == 1
-                # logind will load libxkbcommon.so dynamically on its own
-                deps = [libdl]
-                extra_includes = [libxkbcommon.get_pkgconfig_variable('includedir')]
+                # logind will load libxkbcommon.so dynamically on its own, but we still
+                # need to specify where the headers are
+                deps = [libdl, libxkbcommon.partial_dependency(compile_args: true)]
         else
                 deps = []
-                extra_includes = []
         endif
 
         executable(
                 'systemd-localed',
                 systemd_localed_sources,
-                include_directories : includes + extra_includes,
+                include_directories : includes,
                 link_with : [libshared],
                 dependencies : deps,
                 install_rpath : rootlibexecdir,
-- 
2.20.1