diff options
author | Iñigo Martínez <inigomartinez@gmail.com> | 2021-09-09 10:34:20 +0200 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2021-09-10 08:39:37 +0000 |
commit | 39912daa11491167cca9298a170210980626cd34 (patch) | |
tree | fd348cdd794b04be61e2fb2afb4053c73857e0fd | |
parent | 93a1d7a60de147a61f0e343a6d8069ceb2a30ded (diff) | |
download | ModemManager-39912daa11491167cca9298a170210980626cd34.tar.gz |
build,meson: Fix libsystemd check
At the moment `libsystemd` is check even if `suspend/resume` and
systemd support are not enabled.
This has been changed so `libsystemd` is checked only if any or both
options are enabled.
-rw-r--r-- | meson.build | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/meson.build b/meson.build index 515f63df5..26dfbe72d 100644 --- a/meson.build +++ b/meson.build @@ -193,21 +193,24 @@ if install_systemdunitdir and systemd_systemdsystemunitdir == '' endif # Suspend/resume support -libsystemd_dep = dependency('libsystemd', version: '>= 209', required: false) -if not libsystemd_dep.found() - libsystemd_dep = dependency('libsystemd-login', version: '>= 183', required: false) +enable_systemd_suspend_resume = get_option('systemd_suspend_resume') +# systemd journal support +enable_systemd_journal = get_option('systemd_journal') + +if enable_systemd_suspend_resume or enable_systemd_journal + libsystemd_dep = dependency('libsystemd', version: '>= 209', required: false) if not libsystemd_dep.found() - libsystemd_dep = dependency('libelogind', version: '>= 209', required: false) + libsystemd_dep = dependency('libsystemd-login', version: '>= 183', required: false) + if not libsystemd_dep.found() + libsystemd_dep = dependency( + 'libelogind', + version: '>= 209', + not_found_message: 'libsystemd, libsystemd-login or elogind must be available at runtime for suspend/resume or systemd journal support', + ) + endif endif endif - -enable_systemd_suspend_resume = get_option('systemd_suspend_resume') -assert(not enable_systemd_suspend_resume or libsystemd_dep.found(), 'libsystemd, libsystemd-login or elogind must be available at runtime for suspend/resume support') config_h.set('WITH_SYSTEMD_SUSPEND_RESUME', enable_systemd_suspend_resume) - -# systemd journal support -enable_systemd_journal = get_option('systemd_journal') -assert(not enable_systemd_journal or libsystemd_dep.found(), 'libsystemd development headers are required') config_h.set('WITH_SYSTEMD_JOURNAL', enable_systemd_journal) # PolicyKit |