seatd: build: check for libelogind before libsystemd v1 APPLIED

Isaac Freund: 1
 build: check for libelogind before libsystemd

 1 files changed, 7 insertions(+), 5 deletions(-)
#275134 running alpine.yml
#275135 running archlinux.yml
#275136 running freebsd.yml
build pending: smoketest-builtin.sh
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~kennylevinsen/public-inbox/patches/11888/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH seatd] build: check for libelogind before libsystemd Export this patch

elogind provides a libsystemd wrapper which is packaged by some distros.
For whatever reason using this wrapper instead of libelogind directly
causes compiler warnings to pop up. Checking for libelogind first
ensures that this wrapper is not used.
 meson.build | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/meson.build b/meson.build
index 49bd049..e4785d9 100644
--- a/meson.build
+++ b/meson.build
@@ -98,15 +98,17 @@ endif

logind_provider = ''
if get_option('logind').enabled()
	logind = dependency('libsystemd', required: false)
	# 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 logind.found()
		add_project_arguments('-DHAVE_SYSTEMD=1', language: 'c')
		logind_provider = 'systemd'
		logind = dependency('libelogind')
		add_project_arguments('-DHAVE_ELOGIND=1', language: 'c')
		logind_provider = 'elogind'
		logind = dependency('libsystemd')
		add_project_arguments('-DHAVE_SYSTEMD=1', language: 'c')
		logind_provider = 'systemd'

	private_files += [