summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorSimon McVittie <smcv@collabora.com>2022-06-24 14:27:10 +0100
committerSimon McVittie <smcv@collabora.com>2022-07-13 20:36:13 +0100
commit4fbdb149878431e71efed1977508d00d7d77376e (patch)
tree5b4afbada6624e72d862838d35311f96d60066f3 /meson.build
parent37e1728638c5caaac393a0db756ce304aa611db1 (diff)
downloaddbus-4fbdb149878431e71efed1977508d00d7d77376e.tar.gz
subprojects: Allow expat and GLib to be built as subprojects
This should let us build everything with a mingw-w64 toolchain, without having to use prebuilt dependencies from MSYS. Signed-off-by: Simon McVittie <smcv@collabora.com>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build16
1 files changed, 14 insertions, 2 deletions
diff --git a/meson.build b/meson.build
index ac8ba6cf..4c3690a2 100644
--- a/meson.build
+++ b/meson.build
@@ -283,7 +283,12 @@ threads = dependency('threads')
config.set('HAVE_MONOTONIC_CLOCK', cc.has_header_symbol('pthread.h', 'CLOCK_MONOTONIC'))
glib = dependency(
- 'glib-2.0', version: '>=2.40', required: get_option('modular_tests'),
+ 'glib-2.0', version: '>=2.40',
+ required: get_option('modular_tests'),
+ fallback: ['glib', 'libglib_dep'],
+ default_options: [
+ 'tests=false',
+ ],
)
if platform_windows
gio = dependency('gio-windows-2.0', required: glib.found())
@@ -294,7 +299,14 @@ use_glib = glib.found() and gio.found()
config.set('DBUS_WITH_GLIB', use_glib)
expat = dependency('expat')
-config.set('HAVE_XML_SETHASHSALT', cc.has_function('XML_SetHashSalt', dependencies: expat))
+if expat.type_name() == 'internal'
+ # Configure-time checks can't act on subprojects that haven't been
+ # built yet, but we know that subprojects/expat.wrap is a new enough
+ # version to have this
+ config.set('HAVE_XML_SETHASHSALT', true)
+else
+ config.set('HAVE_XML_SETHASHSALT', cc.has_function('XML_SetHashSalt', dependencies: expat))
+endif
selinux = dependency('libselinux', version: '>=2.0.86', required: get_option('selinux'))