Skip to content

Commit

Permalink
meson: add options to disable polkit and libsystemd
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
brad0 authored and LudovicRousseau committed Aug 23, 2024
1 parent daf1d93 commit d688f7e
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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')
Expand Down

0 comments on commit d688f7e

Please sign in to comment.