From 943c7d18cc7c9300e1a6b4b859558b8c7ac540cd Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Mon, 11 Nov 2024 09:36:15 +0200 Subject: [PATCH] meson: autodetect systemd --- meson.build | 8 ++++++-- nix/default.nix | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 76765645..e4abad36 100644 --- a/meson.build +++ b/meson.build @@ -52,8 +52,12 @@ backtrace_dep = cpp_compiler.find_library('execinfo', required: false) epoll_dep = dependency('epoll-shim', required: false) # timerfd on BSDs # Handle options -if get_option('systemd').enabled() - systemd = dependency('systemd') +systemd_option = get_option('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') subdir('systemd') endif diff --git a/nix/default.nix b/nix/default.nix index 29d31485..90c92272 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -152,7 +152,6 @@ in (mapAttrsToList mesonEnable { "xwayland" = enableXWayland; "legacy_renderer" = legacyRenderer; - "systemd" = withSystemd; }) (mapAttrsToList mesonBool { "b_pch" = false;