From d688f7ed515f62d0edaffd1b3cc9cdbe459ddae5 Mon Sep 17 00:00:00 2001 From: Brad Smith Date: Wed, 14 Aug 2024 10:27:53 -0400 Subject: [PATCH] meson: add options to disable polkit and libsystemd Currently the build option will only make PolKit optional at compilation time and disable it only if polkit-gobject-1 is actually missing on the system. For example, if I have PolKit available and -Dpolkit=false, pcscd will still use PolKit because polkit_dep.found() will be true. --- meson.build | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/meson.build b/meson.build index caf3af0e..d529690a 100644 --- a/meson.build +++ b/meson.build @@ -117,14 +117,18 @@ endif cc = meson.get_compiler('c') dl_deps = cc.find_library('dl', required: false) -polkit_dep = dependency('polkit-gobject-1', required : get_option('polkit')) -if polkit_dep.found() +pcscd_dep += dl_deps + +if get_option('polkit') + polkit_dep = dependency('polkit-gobject-1') + pcscd_dep += polkit_dep conf_data.set('HAVE_POLKIT', true) features += 'polkit' endif -systemd_dep = dependency('libsystemd', required : get_option('libsystemd')) -if systemd_dep.found() +if get_option('libsystemd') + systemd_dep = dependency('libsystemd') + pcscd_dep += systemd_dep conf_data.set('USE_LIBSYSTEMD', true) features += 'systemd' endif @@ -139,8 +143,6 @@ if pcsc_arch == 'Darwin' endif conf_data.set_quoted('PCSC_ARCH', pcsc_arch) -pcscd_dep += [polkit_dep, systemd_dep, dl_deps] - features += pcsc_arch features += target_machine.cpu() features += 'ipcdir=' + get_option('ipcdir')