From aa29a7f0e28c32a8fde9e4b0400a0355f2b2d56c Mon Sep 17 00:00:00 2001 From: Colin Date: Thu, 30 May 2024 14:36:45 +0000 Subject: [PATCH] fix building with `-Dsystemd=auto` and no systemd `-Dsystemd=auto` previously worked only if systemd was present, i.e. synonymous to `-Dsystemd=enabled`. otherwise, the build would error: ``` > Run-time dependency systemd found: NO (tried pkgconfig) > > meson.build:111:12: ERROR: Dependency "systemd" not found, tried pkgconfig ``` --- meson.build | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index 4ecfba7d..96d6cb30 100644 --- a/meson.build +++ b/meson.build @@ -108,12 +108,12 @@ if build_modules endif if build_modules - systemd = dependency('systemd', required: get_option('systemd')) - libsystemd_dep = dependency('libsystemd',required: get_option('systemd')) - libelogind_dep = dependency('libelogind', required: get_option('elogind')) - summary({'systemd conf data': systemd.found(), - 'libsystemd': libsystemd_dep.found(), - 'libelogind': libelogind_dep.found()}, bool_yn: true) + systemd = dependency('systemd', required: get_option('systemd').disable_auto_if(true).enabled()) + libsystemd_dep = dependency('libsystemd', required: get_option('systemd').enabled()) + libelogind_dep = dependency('libelogind', required: get_option('elogind').enabled()) + # summary({'systemd conf data': systemd.found(), + # 'libsystemd': libsystemd_dep.found(), + # 'libelogind': libelogind_dep.found()}, bool_yn: true) endif gnome = import('gnome')