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




commit 3c9df4fbd5701b46053a4a49517552ac5b36b2a1
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 a2cd84a7..3dfbd2cc 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]