[gnome-initial-setup/wip/wjt/build-misc: 3/4] meson: Replace get_pkgconfig_variable with get_variable
- From: Will Thompson <wjt src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup/wip/wjt/build-misc: 3/4] meson: Replace get_pkgconfig_variable with get_variable
- Date: Wed, 22 Jun 2022 21:45:34 +0000 (UTC)
commit f92d2e02fd007bfeda67730f7525bedc4f08d97a
Author: Will Thompson <will willthompson co uk>
Date: Wed Jun 22 22:42:21 2022 +0100
meson: Replace get_pkgconfig_variable with get_variable
The former is deprecated in favour of the latter, which has been
available since Meson 0.51.0.
While we're here, do the fallback in the case where soupapiversion is
not defined with a keyword argument to the get_variable() call, rather
than manually. This suppresses a warning from Meson.
gnome-initial-setup/meson.build | 24 ++++++++++++------------
meson.build | 4 ++--
2 files changed, 14 insertions(+), 14 deletions(-)
---
diff --git a/gnome-initial-setup/meson.build b/gnome-initial-setup/meson.build
index d3249f23..835f75b6 100644
--- a/gnome-initial-setup/meson.build
+++ b/gnome-initial-setup/meson.build
@@ -36,19 +36,19 @@ else
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
+geocode_soup_version = geocode_glib_dep.get_variable(
+ pkgconfig: 'soupapiversion',
+ default_value: '2.4', # Pre libsoup3 support
+)
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
gweather_dep = dependency ('gweather4', fallback: ['libgweather', 'libgweather_dep'])
-gweather_soup_version = gweather_dep.get_pkgconfig_variable('soupapiversion')
-if gweather_soup_version == ''
- gweather_soup_version = '2.4' # Pre libsoup3 support
-endif
+gweather_soup_version = gweather_dep.get_variable(
+ pkgconfig: 'soupapiversion',
+ default_value: '2.4', # Pre libsoup3 support
+)
if gweather_soup_version != libsoup_api_version
error('libgweather was built against a different API of libsoup. @0@ instead of
@1@.'.format(gweather_soup_version, libsoup_api_version))
endif
@@ -57,10 +57,10 @@ librest_dep = dependency('rest-1.0', required: false)
if not librest_dep.found()
librest_dep = dependency('rest-0.7')
endif
-librest_soup_version = librest_dep.get_pkgconfig_variable('soupapiversion')
-if librest_soup_version == ''
- librest_soup_version = '2.4' # Pre libsoup3 support
-endif
+librest_soup_version = librest_dep.get_variable(
+ pkgconfig: 'soupapiversion',
+ default_value: '2.4', # Pre libsoup3 support
+)
if librest_soup_version != libsoup_api_version
error('librest was built against a different API of libsoup. @0@ instead of
@1@.'.format(librest_soup_version, libsoup_api_version))
endif
diff --git a/meson.build b/meson.build
index be3f21bd..c56ed390 100644
--- a/meson.build
+++ b/meson.build
@@ -36,8 +36,8 @@ if enable_systemd
systemd_dep = dependency('systemd', version: '>= 242', required: false)
assert(systemd_dep.found(), 'Systemd support explicitly required, but systemd not found')
- systemd_userunitdir = systemd_dep.get_pkgconfig_variable('systemduserunitdir',
- define_variable: ['prefix', prefix])
+ systemd_userunitdir = systemd_dep.get_variable(pkgconfig: 'systemduserunitdir',
+ pkgconfig_define: ['prefix', prefix])
endif
vendor_conf_file = get_option('vendor-conf-file')
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]