meson: -Dsystemd-units-dir installs even if systemd is not found

If -Dsystemd-units-dir is explicitly set, then install the systemd
service files regardless of whether systemd is available or not.
This commit is contained in:
Daniel Eklöf 2022-05-11 20:58:07 +02:00
parent 62fe452cc2
commit 15d45d5704
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -247,16 +247,16 @@ install_data(
install_dir: join_paths(get_option('datadir'), 'applications'))
systemd = dependency('systemd', required: false)
if systemd.found()
custom_systemd_units_dir = get_option('systemd-units-dir')
if systemd.found() or custom_systemd_units_dir != ''
configuration = configuration_data()
configuration.set('bindir', join_paths(get_option('prefix'), get_option('bindir')))
custom_units_dir = get_option('systemd-units-dir')
if (custom_units_dir == '')
if (custom_systemd_units_dir == '')
systemd_units_dir = systemd.get_variable('systemduserunitdir')
else
systemd_units_dir = custom_units_dir
systemd_units_dir = custom_systemd_units_dir
endif
configure_file(