[gnome-session/wip/benzea/systemd-user-switch: 18/31] meson: Add compile time option to control systemd session management



commit c2a2402576cc4a42f4228425362cea6406d39793
Author: Benjamin Berg <bberg redhat com>
Date:   Mon May 13 12:10:05 2019 +0200

    meson: Add compile time option to control systemd session management
    
    This is in preparation to add the other parts that allow us to use the
    systemd user instance for session management.

 meson.build       | 7 +++++++
 meson_options.txt | 1 +
 2 files changed, 8 insertions(+)
---
diff --git a/meson.build b/meson.build
index 35866e26..5950bb39 100644
--- a/meson.build
+++ b/meson.build
@@ -120,6 +120,8 @@ enable_session_selector = get_option('session_selector')
 session_tracking = 'null backend'
 
 enable_systemd = get_option('systemd')
+enable_systemd_session = get_option('systemd_session') != 'disable'
+use_systemd_session = get_option('systemd_session') == 'default'
 enable_systemd_journal = get_option('systemd_journal')
 enable_consolekit = get_option('consolekit')
 if enable_systemd or enable_consolekit
@@ -161,9 +163,14 @@ if enable_systemd or enable_consolekit
     endif
   endif
 endif
+if enable_systemd_session
+  assert(enable_systemd, 'Systemd support must be enabled when using systemd session management')
+endif
 config_h.set('HAVE_SYSTEMD', enable_systemd)
+config_h.set('ENABLE_SYSTEMD_SESSION', enable_systemd_session)
 config_h.set('ENABLE_SYSTEMD_JOURNAL', enable_systemd_journal)
 config_h.set('HAVE_CONSOLEKIT', enable_consolekit)
+config_h.set10('USE_SYSTEMD_SESSION', use_systemd_session)
 
 configure_file(
   output: 'config.h',
diff --git a/meson_options.txt b/meson_options.txt
index 05174fec..4c05dc6e 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -1,6 +1,7 @@
 option('deprecation_flags', type: 'boolean', value: false, description: 'use *_DISABLE_DEPRECATED flags')
 option('session_selector', type: 'boolean', value: false, description: 'enable building a custom session 
selector dialog')
 option('systemd', type: 'boolean', value: true, description: 'Use systemd')
+option('systemd_session', type: 'combo', choices: ['disable', 'enable', 'default'], value: 'default', 
description: 'Whether to include systemd session support and use it by default')
 option('systemd_journal', type: 'boolean', value:'true', description: 'Send log to systemd-journal')
 option('consolekit', type: 'boolean', value: false, description: 'Use consolekit')
 option('docbook', type: 'boolean', value: true, description: 'build documentation')


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]