Skip to content

Commit df62bfb

Browse files
committed
build: Add D-Bus fallback
Add a wrap for D-Bus so we can use it as fallback for static builds. Signed-off-by: Daniel Wagner <[email protected]>
1 parent 39e3630 commit df62bfb

3 files changed

Lines changed: 23 additions & 2 deletions

File tree

meson.build

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,24 @@ if openssl_dep.found()
8989
description: 'OpenSSL/LibreSSL API version @0@'.format(api_version))
9090
endif
9191

92-
# Check for libdus availability. Optional, only required for MCTP dbus scan
93-
libdbus_dep = dependency('dbus-1', required: false)
92+
if get_option('libdbus').disabled()
93+
libdbus_dep = dependency('', required: false)
94+
else
95+
# Check for libdus availability. Optional, only required for MCTP dbus scan
96+
libdbus_dep = dependency(
97+
'dbus-1',
98+
required: true,
99+
fallback: ['dbus', 'libdbus_dep'],
100+
default_options: [
101+
'default_library=static',
102+
'embedded_tests=false',
103+
'message_bus=false',
104+
'modular_tests=disabled',
105+
'tools=false',
106+
],
107+
)
108+
endif
109+
94110
conf.set('CONFIG_DBUS', libdbus_dep.found(), description: 'Enable dbus support?')
95111

96112
# local (cross-compilable) implementations of ccan configure steps

meson_options.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ option('docs-build', type : 'boolean', value : false, description : 'build docu
99

1010
option('python', type : 'combo', choices : ['auto', 'true', 'false'], description : 'Generate libnvme python bindings')
1111
option('openssl', type : 'feature', value: 'auto', description : 'OpenSSL support')
12+
option('libdbus', type : 'feature', value: 'auto', description : 'libdbus support')

subprojects/dbus.wrap

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[wrap-git]
2+
url = https://gitlab.freedesktop.org/dbus/dbus.git
3+
revision = 218b35a57cdeab667c75d6ef34f901b8ead00056
4+
depth = 1

0 commit comments

Comments
 (0)