aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorJon Turney <jon.turney@dronecode.org.uk>2018-02-06 18:11:29 +0000
committerJussi Pakkanen <jpakkane@gmail.com>2018-02-08 00:35:38 +0200
commit7bfcf68777f5bee3cab95685acf3c4177f6b6498 (patch)
treecd8bcc2ec6c0750434fc4f437744fcec6a59223c /mesonbuild
parent2b0973acd90cd1ff7db7369d5118363a2eaea51e (diff)
downloadmeson-7bfcf68777f5bee3cab95685acf3c4177f6b6498.zip
meson-7bfcf68777f5bee3cab95685acf3c4177f6b6498.tar.gz
meson-7bfcf68777f5bee3cab95685acf3c4177f6b6498.tar.bz2
Add get_pkgconfig_variable(default:)
Also use that to squelch the warning for internal uses which handle the variable missing case (just gnome at the moment) A follow up to PR #2914
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/dependencies/base.py5
-rw-r--r--mesonbuild/modules/gnome.py4
2 files changed, 6 insertions, 3 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index f89e631..1e3c49c 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -561,7 +561,10 @@ class PkgConfigDependency(ExternalDependency):
if not variable:
ret, out = self._call_pkgbin(['--print-variables', self.name])
if not re.search(r'^' + variable_name + r'$', out, re.MULTILINE):
- mlog.warning("pkgconfig variable '%s' not defined for dependency %s." % (variable_name, self.name))
+ if 'default' in kwargs:
+ variable = kwargs['default']
+ else:
+ mlog.warning("pkgconfig variable '%s' not defined for dependency %s." % (variable_name, self.name))
mlog.debug('Got pkgconfig variable %s : %s' % (variable_name, variable))
return variable
diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py
index db85420..218e3b3 100644
--- a/mesonbuild/modules/gnome.py
+++ b/mesonbuild/modules/gnome.py
@@ -362,7 +362,7 @@ class GnomeModule(ExtensionModule):
ldflags.update([lib])
if isinstance(dep, PkgConfigDependency):
- girdir = dep.get_pkgconfig_variable("girdir", {})
+ girdir = dep.get_pkgconfig_variable("girdir", {'default': ''})
if girdir:
gi_includes.update([girdir])
elif isinstance(dep, (build.StaticLibrary, build.SharedLibrary)):
@@ -553,7 +553,7 @@ class GnomeModule(ExtensionModule):
if subdir not in typelib_includes:
typelib_includes.append(subdir)
elif isinstance(dep, PkgConfigDependency):
- girdir = dep.get_pkgconfig_variable("girdir", {})
+ girdir = dep.get_pkgconfig_variable("girdir", {'default': ''})
if girdir and girdir not in typelib_includes:
typelib_includes.append(girdir)
# ldflags will be misinterpreted by gir scanner (showing