[libgweather/ebassi/libsoup3: 2/6] build: Include libsoup api version in pkg-config
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libgweather/ebassi/libsoup3: 2/6] build: Include libsoup api version in pkg-config
- Date: Tue, 19 Oct 2021 16:38:24 +0000 (UTC)
commit 77c6e3cdab5f27e596c49fbe29f0b1a0617a3d1d
Author: Patrick Griffis <pgriffis igalia com>
Date: Tue Sep 21 11:45:42 2021 -0500
build: Include libsoup api version in pkg-config
libgweather/meson.build | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
---
diff --git a/libgweather/meson.build b/libgweather/meson.build
index ed9b2ab8..19774066 100644
--- a/libgweather/meson.build
+++ b/libgweather/meson.build
@@ -97,9 +97,20 @@ configure_file(
if get_option('soup2')
libsoup_name = 'libsoup-2.4'
libsoup_req_version = '>= 2.44.0'
+ libsoup_api_version = '2.4'
else
libsoup_name = 'libsoup-3.0'
libsoup_req_version = '>= 2.99.2'
+ libsoup_api_version = '3.0'
+endif
+
+geocode_glib_dep = dependency('geocode-glib-1.0')
+geocode_soup_version = geocode_glib_dep.get_pkgconfig_variable('soupapiversion')
+if geocode_soup_version == ''
+ geocode_soup_version = '2.4' # Pre libsoup3 support
+endif
+if geocode_soup_version != libsoup_api_version
+ error('geocode-glib was built against a different API of libsoup. @0@ instead of
@1@.'.format(geocode_soup_version, libsoup_api_version))
endif
libsoup_dep = dependency(libsoup_name, version: libsoup_req_version)
@@ -108,7 +119,7 @@ deps_libgweather = [
dependency('gio-2.0', version: glib_req_version),
libsoup_dep,
dependency('libxml-2.0', version: libxml_req_version),
- dependency('geocode-glib-1.0'),
+ geocode_glib_dep,
c_compiler.find_library('m', required: false),
]
@@ -249,6 +260,9 @@ pkgconfig.generate(
'libxml-2.0',
'geocode-glib-1.0',
],
+ variables: [
+ 'soupapiversion=' + libsoup_api_version,
+ ]
)
if get_option('tests')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]