meson: autodetect systemd

This commit is contained in:
Mihai Fufezan 2024-11-11 09:36:15 +02:00
parent ccfae82ad1
commit 943c7d18cc
2 changed files with 6 additions and 3 deletions

View file

@ -52,8 +52,12 @@ backtrace_dep = cpp_compiler.find_library('execinfo', required: false)
epoll_dep = dependency('epoll-shim', required: false) # timerfd on BSDs epoll_dep = dependency('epoll-shim', required: false) # timerfd on BSDs
# Handle options # Handle options
if get_option('systemd').enabled() systemd_option = get_option('systemd')
systemd = dependency('systemd') systemd = dependency('systemd', required: systemd_option)
systemd_option.enable_auto_if(systemd.found())
if (systemd_option.enabled())
message('Enabling systemd integration')
add_project_arguments('-DUSES_SYSTEMD', language: 'cpp') add_project_arguments('-DUSES_SYSTEMD', language: 'cpp')
subdir('systemd') subdir('systemd')
endif endif

View file

@ -152,7 +152,6 @@ in
(mapAttrsToList mesonEnable { (mapAttrsToList mesonEnable {
"xwayland" = enableXWayland; "xwayland" = enableXWayland;
"legacy_renderer" = legacyRenderer; "legacy_renderer" = legacyRenderer;
"systemd" = withSystemd;
}) })
(mapAttrsToList mesonBool { (mapAttrsToList mesonBool {
"b_pch" = false; "b_pch" = false;