diff options
author | oreo639 <oreo6391@gmail.com> | 2022-09-09 21:43:11 -0700 |
---|---|---|
committer | Ray Strode <halfline@gmail.com> | 2023-03-05 15:41:59 +0000 |
commit | 90bae02877a10bdfea922666bfff68486208c31c (patch) | |
tree | 8ee95c89fa46d544bed7ee13ab06f488616a9424 | |
parent | 543881614a6e8333d1f39108edd8eb6218cec619 (diff) | |
download | gnome-session-90bae02877a10bdfea922666bfff68486208c31c.tar.gz |
meson: Add option to override sytemd user unit directory
This also fixes building with elogind.
-rw-r--r-- | meson.build | 9 | ||||
-rw-r--r-- | meson_options.txt | 1 |
2 files changed, 7 insertions, 3 deletions
diff --git a/meson.build b/meson.build index 8e20113b..45225a28 100644 --- a/meson.build +++ b/meson.build @@ -123,9 +123,12 @@ if enable_systemd or enable_consolekit # Check for systemd if enable_systemd - systemd_dep = dependency('systemd', version: '>= 242', required: true) - systemd_userunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir', - define_variable: ['prefix', prefix]) + systemd_userunitdir = get_option('systemduserunitdir') + if systemd_userunitdir == '' + systemd_dep = dependency('systemd', version: '>= 242', required: true) + systemd_userunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir', + define_variable: ['prefix', prefix]) + endif libsystemd_dep = dependency('libsystemd', version: '>= 209', required: false) session_bin_deps += libsystemd_dep diff --git a/meson_options.txt b/meson_options.txt index 4c05dc6e..d3bd3838 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -3,6 +3,7 @@ option('session_selector', type: 'boolean', value: false, description: 'enable b 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('systemduserunitdir', type: 'string', description: 'Directory for systemd user service files') option('consolekit', type: 'boolean', value: false, description: 'Use consolekit') option('docbook', type: 'boolean', value: true, description: 'build documentation') option('man', type: 'boolean', value: true, description: 'build documentation (requires xmlto)') |