diff options
author | Matt Turner <mattst88@gmail.com> | 2022-02-15 12:22:00 -0800 |
---|---|---|
committer | Daniel P. Berrangé <berrange@redhat.com> | 2022-02-25 09:15:49 +0000 |
commit | 3a0fef72b11e2a22cac61a93a5b5b796885ac7e7 (patch) | |
tree | 5136cfba7bffa0c50cb05f3376fac28220f4db56 | |
parent | 44c1141770edce04bb9729d1fbb0a7b83aa73ad7 (diff) | |
download | libosinfo-3a0fef72b11e2a22cac61a93a5b5b796885ac7e7.tar.gz |
build: Add option to select libsoup ABI
This allows distributions that ship both versions of libsoup and choose
which version of libsoup will be linked.
Signed-off-by: Matt Turner <mattst88@gmail.com>
-rw-r--r-- | meson.build | 11 | ||||
-rw-r--r-- | meson_options.txt | 7 |
2 files changed, 15 insertions, 3 deletions
diff --git a/meson.build b/meson.build index a664402..037e4f3 100644 --- a/meson.build +++ b/meson.build @@ -71,10 +71,15 @@ gio_dep = dependency('gio-2.0', version: glib_version_info) gobject_dep = dependency('gobject-2.0', version: glib_version_info) # everything else -libsoup_dep = dependency('libsoup-3.0', required: false) -# fallback to libsoup2 + +libsoup_abi = get_option('libsoup-abi') +libsoup_dep = disabler() +if ['auto', '3.0'].contains(libsoup_abi) + libsoup_dep = dependency('libsoup-3.0', required: libsoup_abi.contains('3.0')) +endif if not libsoup_dep.found() - libsoup_dep = dependency('libsoup-2.4') +# fallback to libsoup2 + libsoup_dep = dependency('libsoup-2.4', required: libsoup_abi.contains('2.4')) endif libxml_dep = dependency('libxml-2.0', version: '>= 2.6.0') libxslt_dep = dependency('libxslt', version: '>= 1.0.0') diff --git a/meson_options.txt b/meson_options.txt index 13fc358..15a361f 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -24,6 +24,13 @@ option('enable-vala', description: 'Enable Vala bindings' ) +option('libsoup-abi', + type: 'combo', + value: 'auto', + choices: ['auto', '2.4', '3.0'], + description: 'Select libsoup ABI version' +) + option('with-pci-ids-path', type: 'string', value: '', |