Add logind feature, with its 'inhibitor' module

The logind feature adds a new inhibitor module which allows to acquire
the inhibitor locks that logind presents.

Signed-off-by: Alexis Cellier <kernelserror@gmail.com>
This commit is contained in:
Alexis Cellier
2021-12-03 23:32:53 +01:00
parent 39f42cdd7e
commit eae65099d0
6 changed files with 217 additions and 1 deletions

View File

@ -86,7 +86,7 @@ wayland_cursor = dependency('wayland-cursor')
wayland_protos = dependency('wayland-protocols')
gtkmm = dependency('gtkmm-3.0', version : ['>=3.22.0'])
dbusmenu_gtk = dependency('dbusmenu-gtk3-0.4', required: get_option('dbusmenu-gtk'))
giounix = dependency('gio-unix-2.0', required: get_option('dbusmenu-gtk'))
giounix = dependency('gio-unix-2.0', required: (get_option('dbusmenu-gtk').enabled() or get_option('logind').enabled()))
jsoncpp = dependency('jsoncpp')
sigcpp = dependency('sigc++-2.0')
libepoll = dependency('epoll-shim', required: false)
@ -242,6 +242,11 @@ if libsndio.found()
src_files += 'src/modules/sndio.cpp'
endif
if (giounix.found() and not get_option('logind').disabled())
add_project_arguments('-DHAVE_GIO_UNIX', language: 'cpp')
src_files += 'src/modules/inhibitor.cpp'
endif
if get_option('rfkill').enabled()
if is_linux
add_project_arguments('-DWANT_RFKILL', language: 'cpp')