mirror of
https://github.com/FeralInteractive/gamemode.git
synced 2025-06-06 15:47:20 +02:00
Add option to use elogind
Signed-off-by: Stephan Lachnit <stephanlachnit@protonmail.com>
This commit is contained in:
parent
1e8312f7e3
commit
953792b4a5
@ -36,8 +36,13 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
#include "common-logging.h"
|
||||
#include "common-pidfds.h"
|
||||
|
||||
#ifdef USE_ELOGIND
|
||||
#include <elogind/sd-bus.h>
|
||||
#include <elogind/sd-daemon.h>
|
||||
#else
|
||||
#include <systemd/sd-bus.h>
|
||||
#include <systemd/sd-daemon.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
|
@ -17,6 +17,7 @@ gamemoded_includes += config_h_dir
|
||||
gamemoded = executable(
|
||||
'gamemoded',
|
||||
sources: daemon_sources,
|
||||
c_args: elogind_args,
|
||||
dependencies: [
|
||||
link_daemon_common,
|
||||
dep_threads,
|
||||
|
15
meson.build
15
meson.build
@ -79,9 +79,22 @@ path_libdir = join_paths(path_prefix, get_option('libdir'))
|
||||
path_libexecdir = join_paths(path_prefix, get_option('libexecdir'))
|
||||
path_sysconfdir = join_paths(path_prefix, get_option('sysconfdir'))
|
||||
|
||||
# Find systemd via pkgconfig
|
||||
# Find systemd / elogind via pkgconfig
|
||||
with_systemd = get_option('with-systemd')
|
||||
with_elogind = get_option('with-elogind')
|
||||
elogind_args = []
|
||||
dep_systemd = []
|
||||
if with_systemd == true
|
||||
if with_elogind == true
|
||||
error('you can\'t use systemd and elogind at the same time')
|
||||
endif
|
||||
dep_systemd = dependency('libsystemd')
|
||||
elif with_elogind == true
|
||||
elogind_args += ['-DUSE_ELOGIND']
|
||||
dep_systemd = dependency('libelogind')
|
||||
else
|
||||
error('you need to use either sd-bus.h from systemd or elogind')
|
||||
endif
|
||||
|
||||
# For the client, libdbus is used
|
||||
dep_dbus = dependency('dbus-1')
|
||||
|
@ -1,12 +1,12 @@
|
||||
option('with-systemd', type: 'boolean', description: 'Use systemd support (unit, etc)', value: 'true')
|
||||
|
||||
# limits.d
|
||||
option('with-pam-group', type: 'string', description: 'Install the limits.d configuration file to allow renicing as an unpriviledged user being part of the specified group')
|
||||
|
||||
# systemd specific
|
||||
option('with-systemd', type: 'boolean', description: 'Use systemd support (unit, etc)', value: true)
|
||||
option('with-systemd-user-unit-dir', type: 'string', description: 'Explicitly set the systemd user unit directory')
|
||||
|
||||
# Not using systemd
|
||||
option('with-elogind', type: 'boolean', description: 'Use elogind\'s Dbus library', value: false)
|
||||
option('with-dbus-service-dir', type: 'string', description: 'Explicitly set the D-BUS session directory')
|
||||
|
||||
# lib dir in gamemoderun
|
||||
|
Loading…
x
Reference in New Issue
Block a user