build: add systemduserunitdir option

This commit is contained in:
Bobby Rong 2021-11-11 21:14:58 +08:00 committed by Corentin Noël
parent 869aa70cfe
commit 78a5f881ba
2 changed files with 5 additions and 1 deletions

View File

@ -45,7 +45,10 @@ install_data('icons/64x64/multitasking-view.svg', install_dir: join_paths(icons_
if get_option('systemd') if get_option('systemd')
dep_systemd = dependency('systemd', required: true) dep_systemd = dependency('systemd', required: true)
systemd_userunitdir = dep_systemd.get_pkgconfig_variable('systemduserunitdir') systemd_userunitdir = get_option('systemduserunitdir')
if systemd_userunitdir == ''
systemd_userunitdir = dep_systemd.get_pkgconfig_variable('systemduserunitdir', define_variable: ['prefix', get_option('prefix')])
endif
bindir = join_paths(get_option('prefix'), get_option('bindir')) bindir = join_paths(get_option('prefix'), get_option('bindir'))
unit_conf = configuration_data() unit_conf = configuration_data()

View File

@ -1,2 +1,3 @@
option ('documentation', type : 'boolean', value : false) option ('documentation', type : 'boolean', value : false)
option ('systemd', type : 'boolean', value : true) option ('systemd', type : 'boolean', value : true)
option ('systemduserunitdir', type : 'string', value : '')