meson: configure systemd service files only if systemd is found

This commit is contained in:
Simon Zeni 2022-01-19 14:11:33 -05:00 committed by Christoph Haag
parent c9b1fcf572
commit 003acb4d5f

View file

@ -51,13 +51,13 @@ service = executable(
install: true,
)
if systemd.found() and not get_option('systemd').disabled()
service_install_path = join_paths(get_option('prefix'), 'bin', 'monado-service')
systemd_user_services_dir = systemd.get_pkgconfig_variable('systemduserunitdir', define_variable : [ 'prefix', get_option('prefix')])
if get_option('systemd-user-unit-dir') != ''
systemd_user_services_dir = get_option('systemd-user-unit-dir')
endif
service_conf_data = configuration_data()
service_conf_data.set('UNIT_NAME', 'monado')
service_conf_data.set('conflicts', 'monado-dev')
@ -80,3 +80,4 @@ configure_file(
configuration: socket_conf_data,
install_dir: systemd_user_services_dir
)
endif