Andrew Geissler | eff2747 | 2021-10-29 15:35:00 -0500 | [diff] [blame^] | 1 | From 260e871fda979f040c94d2011545e8122bed68ca Mon Sep 17 00:00:00 2001 |
| 2 | From: Alexander Kanavin <alex@linutronix.de> |
| 3 | Date: Mon, 18 Oct 2021 10:13:07 +0200 |
| 4 | Subject: [PATCH] meson: use partial_dependency() to get include directory |
| 5 | |
| 6 | Getting the variable directly from pkg-config is prone to host |
| 7 | contamination when building in sysroots as the |
| 8 | compiler starts looking for the headers on the host in addition to |
| 9 | the sysroot. |
| 10 | |
| 11 | Upstream-Status: Submitted [https://github.com/systemd/systemd/pull/21027] |
| 12 | Signed-off-by: Alexander Kanavin <alex@linutronix.de> |
| 13 | --- |
| 14 | meson.build | 9 ++++----- |
| 15 | 1 file changed, 4 insertions(+), 5 deletions(-) |
| 16 | |
| 17 | diff --git a/meson.build b/meson.build |
| 18 | index df53c6156d..38fb37dd75 100644 |
| 19 | --- a/meson.build |
| 20 | +++ b/meson.build |
| 21 | @@ -2618,18 +2618,17 @@ endif |
| 22 | |
| 23 | if conf.get('ENABLE_LOCALED') == 1 |
| 24 | if conf.get('HAVE_XKBCOMMON') == 1 |
| 25 | - # logind will load libxkbcommon.so dynamically on its own |
| 26 | - deps = [libdl] |
| 27 | - extra_includes = [libxkbcommon.get_pkgconfig_variable('includedir')] |
| 28 | + # logind will load libxkbcommon.so dynamically on its own, but we still |
| 29 | + # need to specify where the headers are |
| 30 | + deps = [libdl, libxkbcommon.partial_dependency(compile_args: true)] |
| 31 | else |
| 32 | deps = [] |
| 33 | - extra_includes = [] |
| 34 | endif |
| 35 | |
| 36 | executable( |
| 37 | 'systemd-localed', |
| 38 | systemd_localed_sources, |
| 39 | - include_directories : includes + extra_includes, |
| 40 | + include_directories : includes, |
| 41 | link_with : [libshared], |
| 42 | dependencies : deps, |
| 43 | install_rpath : rootlibexecdir, |
| 44 | -- |
| 45 | 2.20.1 |
| 46 | |