[libgweather/pgriffis/libsoup-ci: 2/5] build: Include libsoup api version in pkg-config




commit 04b16535a902d6cd6f606e62b79bb175447cb03c
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 |  3 +++
 meson.build             | 10 ++++++++++
 2 files changed, 13 insertions(+)
---
diff --git a/libgweather/meson.build b/libgweather/meson.build
index 2fd6f3b8..18684570 100644
--- a/libgweather/meson.build
+++ b/libgweather/meson.build
@@ -241,6 +241,9 @@ pkgconfig.generate(
     'libxml-2.0',
     'geocode-glib-1.0',
   ],
+  variables: [
+    'soupapiversion=' + libsoup_api_version,
+  ]
 )
 
 subdir('tests')
diff --git a/meson.build b/meson.build
index c27dd605..62f1e766 100644
--- a/meson.build
+++ b/meson.build
@@ -41,9 +41,11 @@ libxml_req_version = '>= 2.6.0'
 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
 
 c_compiler = meson.get_compiler('c')
@@ -55,6 +57,14 @@ geocode_glib_dep = dependency('geocode-glib-1.0')
 math_dep = c_compiler.find_library('m', required : false)
 deps_libgweather = [math_dep, gtk_dep, glib_dep, libsoup_dep, libxml_dep, geocode_glib_dep]
 
+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
+
 pylint = find_program('pylint-3', 'pylint3', 'pylint', required: false)
 pylint_flags = [
   '-d', 'C0111',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]