Use feature options for libcap/logind

We now use a combo choice between systemd/elogind as they are mutually
exclusive anyway.
This commit is contained in:
Scott Anderson 2018-08-22 19:53:00 +12:00
parent 3fa3dca6d5
commit 94ed2fc7bb
3 changed files with 8 additions and 21 deletions

View File

@ -44,9 +44,9 @@ else
backend_files += files('session/direct.c') backend_files += files('session/direct.c')
endif endif
if conf_data.get('WLR_HAS_SYSTEMD', false) if logind.found()
backend_files += files('session/logind.c') backend_files += files('session/logind.c')
backend_deps += systemd backend_deps += logind
endif endif
if conf_data.get('WLR_HAS_X11_BACKEND', false) 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 backend_deps += xcb_xkb
endif endif
if conf_data.get('WLR_HAS_ELOGIND', false)
backend_files += files('session/logind.c')
backend_deps += elogind
endif
lib_wlr_backend = static_library( lib_wlr_backend = static_library(
'wlr_backend', 'wlr_backend',
backend_files, backend_files,

View File

@ -62,27 +62,22 @@ libinput = dependency('libinput', version: '>=1.7.0')
xkbcommon = dependency('xkbcommon') xkbcommon = dependency('xkbcommon')
udev = dependency('libudev') udev = dependency('libudev')
pixman = dependency('pixman-1') pixman = dependency('pixman-1')
libcap = dependency('libcap', required: get_option('enable-libcap') == 'true') libcap = dependency('libcap', required: get_option('libcap'))
systemd = dependency('libsystemd', required: get_option('enable-systemd') == 'true') logind = dependency('lib' + get_option('logind-provider'), required: get_option('logind'))
elogind = dependency('libelogind', required: get_option('enable-elogind') == 'true')
math = cc.find_library('m', required: false) math = cc.find_library('m', required: false)
exclude_headers = [] exclude_headers = []
wlr_parts = [] wlr_parts = []
wlr_deps = [] wlr_deps = []
if libcap.found() and get_option('enable-libcap') != 'false' if libcap.found()
conf_data.set('WLR_HAS_LIBCAP', true) conf_data.set('WLR_HAS_LIBCAP', true)
wlr_deps += libcap wlr_deps += libcap
endif endif
if systemd.found() and get_option('enable-systemd') != 'false' if logind.found()
conf_data.set('WLR_HAS_SYSTEMD', true) conf_data.set('WLR_HAS_' + get_option('logind-provider').to_upper(), true)
wlr_deps += systemd wlr_deps += logind
endif
if elogind.found() and get_option('enable-elogind') != 'false'
conf_data.set('WLR_HAS_ELOGIND', true)
endif endif
if get_option('enable-x11_backend') or get_option('enable-xwayland') if get_option('enable-x11_backend') or get_option('enable-xwayland')

View File

@ -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-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-xwayland', type: 'boolean', value: true, description: 'Enable support X11 applications')
option('enable-x11_backend', type: 'boolean', value: true, description: 'Enable X11 backend') option('enable-x11_backend', type: 'boolean', value: true, description: 'Enable X11 backend')