diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2015-08-27 20:54:44 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2015-08-27 20:54:44 +0300 |
commit | ee4a71f77c33c37d2942a9b87592b3c6cbbc3d5c (patch) | |
tree | 0cb5a3da384a7c22f9571972d72b7b9d292e263a | |
parent | 192c96acefbff35044df19ad6f764d6ff28e4bce (diff) | |
download | meson-ee4a71f77c33c37d2942a9b87592b3c6cbbc3d5c.zip meson-ee4a71f77c33c37d2942a9b87592b3c6cbbc3d5c.tar.gz meson-ee4a71f77c33c37d2942a9b87592b3c6cbbc3d5c.tar.bz2 |
Do not do gir generation if dependency is not found. Closes #241.
-rw-r--r-- | modules/gnome.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/gnome.py b/modules/gnome.py index 7e51174..ac68515 100644 --- a/modules/gnome.py +++ b/modules/gnome.py @@ -21,6 +21,8 @@ import subprocess from coredata import MesonException import mlog +girwarning_printed = False + class GnomeModule: def compile_resources(self, state, args, kwargs): @@ -49,7 +51,14 @@ class GnomeModule: girtarget = girtarget.held_object if not isinstance(girtarget, (build.Executable, build.SharedLibrary)): raise MesonException('Gir target must be an executable or shared library') - pkgstr = subprocess.check_output(['pkg-config', '--cflags', 'gobject-introspection-1.0']) + try: + pkgstr = subprocess.check_output(['pkg-config', '--cflags', 'gobject-introspection-1.0']) + except Exception: + global girwarning_printed + if not girwarning_printed: + mlog.log(mlog.bold('Warning:'), 'gobject-introspection dependency was not found, disabling gir generation.') + girwarning_printed = True + return [] pkgargs = pkgstr.decode().strip().split() ns = kwargs.pop('namespace') nsversion = kwargs.pop('nsversion') |