diff options
author | Kenny Levinsen <kl@kl.wtf> | 2021-03-16 12:52:31 +0100 |
---|---|---|
committer | Kenny Levinsen <kl@kl.wtf> | 2021-03-16 13:03:57 +0100 |
commit | e802d381a168789a593cdf583562758c3f26f305 (patch) | |
tree | 00bae0caa085dd59779c8a445f8bfec25c7623ea | |
parent | e303e113345f3774188f3c0d83af124984d58902 (diff) |
meson: Fix logind backend auto mode
-rw-r--r-- | meson.build | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/meson.build b/meson.build index ff56845..fe9ab21 100644 --- a/meson.build +++ b/meson.build @@ -111,25 +111,25 @@ if get_option('seatd').enabled() endif logind_provider = '' -if get_option('logind').enabled() - # Check for libelogind first, as elogind may provide a libsystemd wrapper - # which can cause issues. - logind = dependency('libelogind', required: false) - add_project_arguments('-DLOGIND_ENABLED=1', language: 'c') +if not get_option('logind').disabled() + foreach logind_provider : ['elogind', 'systemd'] + logind = dependency('lib@0@'.format(logind_provider), required: false) + if logind.found() + break + endif + endforeach + if logind.found() - add_project_arguments('-DHAVE_ELOGIND=1', language: 'c') - logind_provider = 'elogind' - else - logind = dependency('libsystemd') - add_project_arguments('-DHAVE_SYSTEMD=1', language: 'c') - logind_provider = 'systemd' + add_project_arguments('-DLOGIND_ENABLED=1', language: 'c') + add_project_arguments('-DHAVE_@0@=1'.format(logind_provider.to_upper()), language: 'c') + private_files += [ + 'libseat/backend/logind.c', + 'common/drm.c', + ] + private_deps += logind + elif get_option('logind').enabled() + error('logind backend was enabled but no supported logind provider was found') endif - - private_files += [ - 'libseat/backend/logind.c', - 'common/drm.c', - ] - private_deps += logind endif if get_option('builtin').enabled() |