meson: make it possible to compile without dbus

Make an option to disable dbus and all the code that depends on
it.

Fixes #1685
This commit is contained in:
Wim Taymans 2021-10-09 15:00:04 +02:00
parent caf0b2df19
commit 5f7c4dec34
8 changed files with 39 additions and 20 deletions

View file

@ -322,7 +322,11 @@ mathlib = cc.find_library('m', required : false)
rt_lib = cc.find_library('rt', required : false) # clock_gettime
dl_lib = cc.find_library('dl', required : false)
pthread_lib = dependency('threads')
dbus_dep = dependency('dbus-1')
dbus_dep = dependency('dbus-1', required : get_option('dbus'))
summary({'dbus (Bluetooth, rtkit, portal, pw-reserve)': dbus_dep.found()}, bool_yn: true, section: 'Misc dependencies')
if dbus_dep.found()
cdata.set('HAVE_DBUS', 1)
endif
sdl_dep = dependency('sdl2', required : get_option('sdl2'))
summary({'SDL 2': sdl_dep.found()}, bool_yn: true, section: 'Misc dependencies')
readline_dep = dependency('readline', required : false)