aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild
diff options
context:
space:
mode:
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]]]]: