aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThibault Saunier <thibault.saunier@osg.samsung.com>2016-10-08 11:16:50 +0200
committerJussi Pakkanen <jpakkane@gmail.com>2016-10-16 18:22:22 +0300
commitc14386d3fce547341d6de2a21f90e3153a13428e (patch)
treefb0b109dacece040ed61479cce7691c9b0923b3c
parent1c876d3d2c1f4dbc8e24844415b6fb7ab4397660 (diff)
downloadmeson-c14386d3fce547341d6de2a21f90e3153a13428e.zip
meson-c14386d3fce547341d6de2a21f90e3153a13428e.tar.gz
meson-c14386d3fce547341d6de2a21f90e3153a13428e.tar.bz2
dependencies: Fix traceback always setting 'variable'
if pkg-config return != 0 and the dep is not required, it will not be set
-rw-r--r--mesonbuild/dependencies.py1
-rw-r--r--test cases/frameworks/7 gnome/gir/meson.build3
2 files changed, 4 insertions, 0 deletions
diff --git a/mesonbuild/dependencies.py b/mesonbuild/dependencies.py
index 1b9e6f4..ccff7a7 100644
--- a/mesonbuild/dependencies.py
+++ b/mesonbuild/dependencies.py
@@ -188,6 +188,7 @@ class PkgConfigDependency(Dependency):
p = subprocess.Popen([self.pkgbin, '--variable=%s' % variable_name, self.name],
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out = p.communicate()[0]
+ variable = ''
if p.returncode != 0:
if self.required:
raise DependencyException('%s dependency %s not found.' %
diff --git a/test cases/frameworks/7 gnome/gir/meson.build b/test cases/frameworks/7 gnome/gir/meson.build
index 287c0d7..a513062 100644
--- a/test cases/frameworks/7 gnome/gir/meson.build
+++ b/test cases/frameworks/7 gnome/gir/meson.build
@@ -14,6 +14,8 @@ girexe = executable(
link_with : girlib
)
+fake_dep = dependency('no-way-this-exists', required: false)
+
gnome.generate_gir(
girlib,
sources : libsources,
@@ -22,6 +24,7 @@ gnome.generate_gir(
symbol_prefix : 'meson_',
identifier_prefix : 'Meson',
includes : ['GObject-2.0'],
+ dependencies : [fake_dep],
install : true
)