check systemd unit dir from systemd.pc in meson

This commit is contained in:
kaliko 2023-04-11 21:06:53 +02:00
parent a57bcd0238
commit 0d2f67b523
2 changed files with 12 additions and 0 deletions

View File

@ -1,4 +1,10 @@
systemd_system_unit_dir = get_option('systemd_system_unit_dir')
if systemd_system_unit_dir == ''
systemd = dependency('systemd', required: false)
if systemd.found()
systemd_system_unit_dir = systemd.get_pkgconfig_variable('systemdsystemunitdir')
endif
endif
if systemd_system_unit_dir == ''
systemd_system_unit_dir = join_paths(get_option('prefix'), 'lib', 'systemd', 'system')
endif

View File

@ -1,4 +1,10 @@
systemd_user_unit_dir = get_option('systemd_user_unit_dir')
if systemd_user_unit_dir == ''
systemd = dependency('systemd', required: false)
if systemd.found()
systemd_user_unit_dir = systemd.get_pkgconfig_variable('systemduserunitdir')
endif
endif
if systemd_user_unit_dir == ''
systemd_user_unit_dir = join_paths(get_option('prefix'), 'lib', 'systemd', 'user')
endif