diff options
author | Matt Turner <mattst88@gmail.com> | 2022-01-26 18:08:24 -0800 |
---|---|---|
committer | Carlos Garnacho <carlosg@gnome.org> | 2022-02-20 20:53:07 +0100 |
commit | 9a8433c47b8326f5291c841de27253ab601efeed (patch) | |
tree | 150f33711cc72932da32279aa82aebbdb3274c41 | |
parent | edcdecdd7d1246396f3412218e8187bfbf555a29 (diff) | |
download | tracker-9a8433c47b8326f5291c841de27253ab601efeed.tar.gz |
build: Add config options for libsoup
This allows distributions that ship both versions to choose which
version of libsoup will be linked.
-rw-r--r-- | meson.build | 21 | ||||
-rw-r--r-- | meson_options.txt | 4 |
2 files changed, 21 insertions, 4 deletions
diff --git a/meson.build b/meson.build index f4dd58fd4..69736cbfb 100644 --- a/meson.build +++ b/meson.build @@ -53,11 +53,21 @@ json_glib = dependency('json-glib-1.0', version: '>= 1.4', required: true) libxml2 = dependency('libxml-2.0', version: '> 2.6') sqlite = dependency('sqlite3', version: '>' + sqlite_required) dbus = dependency('dbus-1') -libsoup2 = dependency('libsoup-2.4', version: '> 2.40', required: false) -libsoup3 = dependency('libsoup-3.0', version: '>= 2.99.2', required: false) -libmath = cc.find_library('m', required: false) -libdl = cc.find_library('dl') +soup = get_option('soup') +if soup.contains('soup2') or soup.contains('auto') + libsoup2 = dependency('libsoup-2.4', version: '> 2.40', + required: soup.contains('soup2')) +else + libsoup2 = disabler() +endif + +if soup.contains('soup3') or soup.contains('auto') + libsoup3 = dependency('libsoup-3.0', version: '>= 2.99.2', + required: soup.contains('soup3')) +else + libsoup3 = disabler() +endif soup_backends = '' if libsoup2.found() @@ -71,6 +81,9 @@ if not libsoup2.found() and not libsoup3.found() error('At least one of libsoup2 or libsoup3 is required') endif +libmath = cc.find_library('m', required: false) +libdl = cc.find_library('dl') + if get_option('man') a2x = find_program('a2x') endif diff --git a/meson_options.txt b/meson_options.txt index ec8ea8bc2..0b5d51759 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -30,3 +30,7 @@ option('tests_tap_protocol', type: 'boolean', value: false, description: 'Whether to enable TAP protocol on tests') option('introspection', type: 'feature', value: 'enabled', description: 'Whether to enable introspection') + +option('soup', type: 'array', value: ['auto'], + choices: ['auto', 'soup2', 'soup3'], + description: 'Which major versions of libsoup to use') |