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 /meson.build | |
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.
Diffstat (limited to 'meson.build')
-rw-r--r-- | meson.build | 21 |
1 files changed, 17 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 |