aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
authorDaniel Mensinger <daniel@mensinger-ka.de>2019-12-05 11:42:50 +0100
committerJussi Pakkanen <jpakkane@gmail.com>2019-12-10 20:17:21 +0200
commitfc800a2cb8cb754e55db1b6ede287079d44dc244 (patch)
tree7c6bdfd3f92594968c7ec6b08485eb99c6e9dbda /mesonbuild
parent38d3fbca9465e4c89e479be5a98b5085a7f83039 (diff)
downloadmeson-fc800a2cb8cb754e55db1b6ede287079d44dc244.zip
meson-fc800a2cb8cb754e55db1b6ede287079d44dc244.tar.gz
meson-fc800a2cb8cb754e55db1b6ede287079d44dc244.tar.bz2
mintro: Add version key to --scan-dependencies (fixes #6287)
Diffstat (limited to 'mesonbuild')
-rw-r--r--mesonbuild/ast/introspection.py7
-rw-r--r--mesonbuild/mintro.py9
2 files changed, 14 insertions, 2 deletions
diff --git a/mesonbuild/ast/introspection.py b/mesonbuild/ast/introspection.py
index eb9517c..709dbac 100644
--- a/mesonbuild/ast/introspection.py
+++ b/mesonbuild/ast/introspection.py
@@ -136,11 +136,15 @@ class IntrospectionInterpreter(AstInterpreter):
def func_dependency(self, node, args, kwargs):
args = self.flatten_args(args)
+ kwargs = self.flatten_kwargs(kwargs)
if not args:
return
name = args[0]
has_fallback = 'fallback' in kwargs
required = kwargs.get('required', True)
+ version = kwargs.get('version', [])
+ if not isinstance(version, list):
+ version = [version]
condition_level = node.condition_level if hasattr(node, 'condition_level') else 0
if isinstance(required, ElementaryNode):
required = required.value
@@ -149,9 +153,10 @@ class IntrospectionInterpreter(AstInterpreter):
self.dependencies += [{
'name': name,
'required': required,
+ 'version': version,
'has_fallback': has_fallback,
'conditional': condition_level > 0,
- 'node': node
+ 'node': node,
}]
def build_target(self, node, args, kwargs, targetclass):
diff --git a/mesonbuild/mintro.py b/mesonbuild/mintro.py
index 5e7bebf..1c9c542 100644
--- a/mesonbuild/mintro.py
+++ b/mesonbuild/mintro.py
@@ -263,7 +263,14 @@ def list_buildsystem_files(builddata: build.Build) -> List[str]:
def list_deps_from_source(intr: IntrospectionInterpreter) -> List[Dict[str, Union[str, bool]]]:
result = [] # type: List[Dict[str, Union[str, bool]]]
for i in intr.dependencies:
- result += [{k: v for k, v in i.items() if k in ['name', 'required', 'has_fallback', 'conditional']}]
+ keys = [
+ 'name',
+ 'required',
+ 'version',
+ 'has_fallback',
+ 'conditional',
+ ]
+ result += [{k: v for k, v in i.items() if k in keys}]
return result
def list_deps(coredata: cdata.CoreData) -> List[Dict[str, Union[str, List[str]]]]: