[gnome-remote-desktop] build: make systemd optional



commit e284cb0e1f110f58edac05b41d638650ebf4b5fc
Author: Dudemanguy <random342 airmail cc>
Date:   Tue Jun 8 09:05:18 2021 -0500

    build: make systemd optional

 meson.build       | 14 ++++++++------
 meson_options.txt |  5 +++++
 2 files changed, 13 insertions(+), 6 deletions(-)
---
diff --git a/meson.build b/meson.build
index a98db6c..da476c2 100644
--- a/meson.build
+++ b/meson.build
@@ -19,7 +19,7 @@ glib_dep = dependency('glib-2.0', version: '>= 2.68')
 gio_dep = dependency('gio-2.0')
 gio_unix_dep = dependency('gio-unix-2.0')
 pipewire_dep = dependency('libpipewire-0.3', version: '>= 0.3.0')
-systemd_dep = dependency('systemd')
+systemd_dep = dependency('systemd', required: get_option('systemd'))
 libsecret_dep = dependency('libsecret-1')
 libnotify_dep = dependency('libnotify')
 
@@ -80,12 +80,14 @@ configure_file(input: 'config.h.meson',
 configinc = include_directories('.')
 
 servicedir = get_option('systemd_user_unit_dir')
-if servicedir == ''
-  servicedir = systemd_dep.get_pkgconfig_variable('systemduserunitdir')
-endif
+if systemd_dep.found()
+  if servicedir == ''
+    servicedir = systemd_dep.get_pkgconfig_variable('systemduserunitdir')
+  endif
 
-if servicedir == ''
-  error('Couldn\'t determine systemd user unit service directory')
+  if servicedir == ''
+    error('Couldn\'t determine systemd user unit service directory')
+  endif
 endif
 
 top_srcdir = meson.current_source_dir()
diff --git a/meson_options.txt b/meson_options.txt
index fb96cd1..b321070 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -13,6 +13,11 @@ option('nvenc',
        value: true,
        description: 'Build with support for hardware acceleration using NVENC and CUDA')
 
+option('systemd',
+       type: 'boolean',
+       value: true,
+       description: 'Enable systemd support')
+
 option('systemd_user_unit_dir',
        type: 'string',
        value: '',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]