Skip to content

Commit

Permalink
Do not do gir generation if dependency is not found. Closes #241.
Browse files Browse the repository at this point in the history
  • Loading branch information
jpakkane committed Aug 27, 2015
1 parent 192c96a commit ee4a71f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion modules/gnome.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
from coredata import MesonException
import mlog

girwarning_printed = False

class GnomeModule:

def compile_resources(self, state, args, kwargs):
Expand Down Expand Up @@ -49,7 +51,14 @@ def generate_gir(self, state, args, kwargs):
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')
Expand Down

0 comments on commit ee4a71f

Please sign in to comment.