diff --git a/meson.build b/meson.build index 4b969c363..0c0a6373d 100644 --- a/meson.build +++ b/meson.build @@ -69,6 +69,7 @@ libuvc = dependency('libuvc', required: false) vulkan = dependency('vulkan', required: true) zlib = dependency('zlib', required: false) survive = dependency('survive', required: false) +dbus = dependency('dbus-1', required: get_option('dbus')) opencv = dependency('opencv4', required: false) if not opencv.found() diff --git a/meson_options.txt b/meson_options.txt index 3cda6b4f8..cde4a7ebb 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -67,6 +67,11 @@ option('wayland', value: 'auto', description: 'Enable support for Wayland rendering.') +option('dbus', + type: 'feature', + value: 'auto', + description: 'Enable support for dbus.') + option('service', type: 'boolean', value: true, diff --git a/src/xrt/auxiliary/meson.build b/src/xrt/auxiliary/meson.build index 146e39653..07ecb68e8 100644 --- a/src/xrt/auxiliary/meson.build +++ b/src/xrt/auxiliary/meson.build @@ -91,15 +91,28 @@ if build_opengl or build_opengles ) endif +aux_os_files = files( + 'os/os_documentation.h', + 'os/os_hid.h', + 'os/os_hid_hidraw.c', + 'os/os_threading.h', + 'os/os_time.h', + 'os/os_ble.h', +) + +aux_os_deps = [] + +if dbus.found() and not get_option('dbus').disabled() + aux_os_files += files( + 'os/os_ble_dbus.c' + ) + aux_os_deps += dbus +endif + lib_aux_os = static_library( 'aux_os', - files( - 'os/os_documentation.h', - 'os/os_hid.h', - 'os/os_hid_hidraw.c', - 'os/os_threading.h', - 'os/os_time.h', - ), + aux_os_files, + dependencies: aux_os_deps, include_directories: xrt_include, ) diff --git a/src/xrt/include/xrt/meson.build b/src/xrt/include/xrt/meson.build index a73120598..32eac19a6 100644 --- a/src/xrt/include/xrt/meson.build +++ b/src/xrt/include/xrt/meson.build @@ -73,6 +73,10 @@ if true have_conf.set('XRT_HAVE_VULKAN', true) endif +if dbus.found() and not get_option('dbus').disabled() + have_conf.set('XRT_HAVE_DBUS', true) +endif + if get_option('layer_depth') have_conf.set('XRT_FEATURE_OPENXR_LAYER_DEPTH', true) endif