diff --git a/meson.build b/meson.build index 66fd77a2a..18a21b628 100644 --- a/meson.build +++ b/meson.build @@ -71,6 +71,7 @@ vulkan = dependency('vulkan', required: true) zlib = dependency('zlib', required: false) survive = dependency('survive', required: false) dbus = dependency('dbus-1', required: get_option('dbus')) +systemd = dependency('libsystemd', required: get_option('systemd')) gst = dependency('gstreamer-1.0', required: false) gst_app = dependency('gstreamer-app-1.0', required: false) gst_video= dependency('gstreamer-video-1.0', required: false) diff --git a/meson_options.txt b/meson_options.txt index 9dc75564a..9c20e17c3 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -77,6 +77,11 @@ option('dbus', value: 'auto', description: 'Enable support for dbus.') +option('systemd', + type: 'feature', + value: 'auto', + description: 'Enable systemd support (for socket activation of service)') + option('service', type: 'boolean', value: true, diff --git a/src/xrt/include/xrt/meson.build b/src/xrt/include/xrt/meson.build index 4abefaa95..8ea490550 100644 --- a/src/xrt/include/xrt/meson.build +++ b/src/xrt/include/xrt/meson.build @@ -76,6 +76,10 @@ if dbus.found() and not get_option('dbus').disabled() have_conf.set('XRT_HAVE_DBUS', true) endif +if systemd.found() and not get_option('systemd').disabled() + have_conf.set('XRT_HAVE_SYSTEMD', true) +endif + if get_option('layer_depth') have_conf.set('XRT_FEATURE_OPENXR_LAYER_DEPTH', true) endif diff --git a/src/xrt/targets/service/meson.build b/src/xrt/targets/service/meson.build index 181746bd3..d5007dfcb 100644 --- a/src/xrt/targets/service/meson.build +++ b/src/xrt/targets/service/meson.build @@ -1,6 +1,11 @@ # Copyright 2020, Collabora, Ltd. # SPDX-License-Identifier: BSL-1.0 +service_deps = [pthreads, libjpeg] +if systemd.found() and not get_option('systemd').disabled() + service_deps += systemd +endif + hack_deps = [] hack_src = [ '../openxr/oxr_sdl2_hack.c'] hack_libs = [] @@ -41,6 +46,6 @@ service = executable( common_include, xrt_include, ] + hack_incs, - dependencies: [pthreads, libjpeg] + hack_deps, + dependencies: [pthreads, libjpeg] + hack_deps + service_deps, install: true, )