From 94ed2fc7bbe9f673f064d3cc5e6841a3879a4268 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Wed, 22 Aug 2018 19:53:00 +1200 Subject: [PATCH] Use feature options for libcap/logind We now use a combo choice between systemd/elogind as they are mutually exclusive anyway. --- backend/meson.build | 9 ++------- meson.build | 17 ++++++----------- meson_options.txt | 3 --- 3 files changed, 8 insertions(+), 21 deletions(-) diff --git a/backend/meson.build b/backend/meson.build index 52abe64d..48a0511a 100644 --- a/backend/meson.build +++ b/backend/meson.build @@ -44,9 +44,9 @@ else backend_files += files('session/direct.c') endif -if conf_data.get('WLR_HAS_SYSTEMD', false) +if logind.found() backend_files += files('session/logind.c') - backend_deps += systemd + backend_deps += logind endif if conf_data.get('WLR_HAS_X11_BACKEND', false) @@ -58,11 +58,6 @@ if conf_data.get('WLR_HAS_X11_BACKEND', false) backend_deps += xcb_xkb endif -if conf_data.get('WLR_HAS_ELOGIND', false) - backend_files += files('session/logind.c') - backend_deps += elogind -endif - lib_wlr_backend = static_library( 'wlr_backend', backend_files, diff --git a/meson.build b/meson.build index 502616ca..7d5266d2 100644 --- a/meson.build +++ b/meson.build @@ -62,27 +62,22 @@ libinput = dependency('libinput', version: '>=1.7.0') xkbcommon = dependency('xkbcommon') udev = dependency('libudev') pixman = dependency('pixman-1') -libcap = dependency('libcap', required: get_option('enable-libcap') == 'true') -systemd = dependency('libsystemd', required: get_option('enable-systemd') == 'true') -elogind = dependency('libelogind', required: get_option('enable-elogind') == 'true') +libcap = dependency('libcap', required: get_option('libcap')) +logind = dependency('lib' + get_option('logind-provider'), required: get_option('logind')) math = cc.find_library('m', required: false) exclude_headers = [] wlr_parts = [] wlr_deps = [] -if libcap.found() and get_option('enable-libcap') != 'false' +if libcap.found() conf_data.set('WLR_HAS_LIBCAP', true) wlr_deps += libcap endif -if systemd.found() and get_option('enable-systemd') != 'false' - conf_data.set('WLR_HAS_SYSTEMD', true) - wlr_deps += systemd -endif - -if elogind.found() and get_option('enable-elogind') != 'false' - conf_data.set('WLR_HAS_ELOGIND', true) +if logind.found() + conf_data.set('WLR_HAS_' + get_option('logind-provider').to_upper(), true) + wlr_deps += logind endif if get_option('enable-x11_backend') or get_option('enable-xwayland') diff --git a/meson_options.txt b/meson_options.txt index 918d7e98..fd1fbf05 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,6 +1,3 @@ -option('enable-libcap', type: 'combo', choices: ['auto', 'true', 'false'], value: 'auto', description: 'Enable support for capabilities') -option('enable-systemd', type: 'combo', choices: ['auto', 'true', 'false'], value: 'auto', description: 'Enable support for logind') -option('enable-elogind', type: 'combo', choices: ['auto', 'true', 'false'], value: 'auto', description: 'Enable support for logind') option('enable-xcb_errors', type: 'combo', choices: ['auto', 'true', 'false'], value: 'auto', description: 'Use xcb-errors util library') option('enable-xwayland', type: 'boolean', value: true, description: 'Enable support X11 applications') option('enable-x11_backend', type: 'boolean', value: true, description: 'Enable X11 backend')