aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/dependencies/base.py
diff options
context:
space:
mode:
authorElliott Sales de Andrade <quantum.analyst@gmail.com>2017-08-05 16:44:39 -0400
committerElliott Sales de Andrade <quantum.analyst@gmail.com>2017-08-05 16:44:39 -0400
commitd9f01ffcea142cdd9bf2bbf1f9213e40efc189b5 (patch)
tree48a0ec80bfd02d97893cc60a5aca90b5cd646f48 /mesonbuild/dependencies/base.py
parentedb260b4f4e79433f38bdda11bc84fa5ee56b080 (diff)
downloadmeson-d9f01ffcea142cdd9bf2bbf1f9213e40efc189b5.zip
meson-d9f01ffcea142cdd9bf2bbf1f9213e40efc189b5.tar.gz
meson-d9f01ffcea142cdd9bf2bbf1f9213e40efc189b5.tar.bz2
Disallow language keyword for unsupported deps.
Also, document it in the manual.
Diffstat (limited to 'mesonbuild/dependencies/base.py')
-rw-r--r--mesonbuild/dependencies/base.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/mesonbuild/dependencies/base.py b/mesonbuild/dependencies/base.py
index f98de44..1f18c52 100644
--- a/mesonbuild/dependencies/base.py
+++ b/mesonbuild/dependencies/base.py
@@ -26,8 +26,9 @@ from .. import mesonlib
from ..mesonlib import MesonException, Popen_safe, flatten, version_compare_many
-# This must be defined in this file to avoid cyclical references.
+# These must be defined in this file to avoid cyclical references.
packages = {}
+_packages_accept_language = set()
class DependencyException(MesonException):
@@ -610,10 +611,15 @@ def find_external_dependency(name, env, kwargs):
raise DependencyException('Keyword "method" must be a string.')
lname = name.lower()
if lname in packages:
+ if lname not in _packages_accept_language and 'language' in kwargs:
+ raise DependencyException('%s dependency does not accept "language" keyword argument' % (lname, ))
dep = packages[lname](env, kwargs)
if required and not dep.found():
raise DependencyException('Dependency "%s" not found' % name)
return dep
+ if 'language' in kwargs:
+ # Remove check when PkgConfigDependency supports language.
+ raise DependencyException('%s dependency does not accept "language" keyword argument' % (lname, ))
pkg_exc = None
pkgdep = None
try: