From 74404db469bc37fbe184cc708a19ccbe58bf83df Mon Sep 17 00:00:00 2001 From: Nirbheek Chauhan Date: Sat, 21 Apr 2018 14:05:31 +0000 Subject: gnome: If pkg-config is not found, assume glib is 2.54 (#3443) * gnome: If pkg-config is not found, assume glib is 2.0 Checking the pkg-config file to confirm tool versions is a hack, and should eventually be replaced with checking the actual versions of the tools. * gnome: Actually assume glib version is 2.54 if not found It is actually not possible to build most projects with the GNOME module if your glib is older, particularly genmarshal and gdbus-codegen generate unusable output without newer arguments that were added for Meson. --- mesonbuild/modules/gnome.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'mesonbuild/modules') diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index c0a3bbf9d..abefe0579 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -67,8 +67,13 @@ class GnomeModule(ExtensionModule): global native_glib_version if native_glib_version is None: glib_dep = PkgConfigDependency('glib-2.0', state.environment, - {'native': True}) - native_glib_version = glib_dep.get_version() + {'native': True, 'required': False}) + if glib_dep.found(): + native_glib_version = glib_dep.get_version() + else: + mlog.warning('Could not detect glib version, assuming 2.54. ' + 'You may get build errors if your glib is older.') + native_glib_version = '2.54' return native_glib_version def __print_gresources_warning(self, state): -- cgit v1.2.3