aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/ast/introspection.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/ast/introspection.py')
-rw-r--r--mesonbuild/ast/introspection.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/mesonbuild/ast/introspection.py b/mesonbuild/ast/introspection.py
index 67a0fe7..44c00b7 100644
--- a/mesonbuild/ast/introspection.py
+++ b/mesonbuild/ast/introspection.py
@@ -51,10 +51,12 @@ class IntrospectionInterpreter(AstInterpreter):
self.default_options = {'backend': self.backend}
self.project_data = {}
self.targets = []
+ self.dependencies = []
self.project_node = None
self.funcs.update({
'add_languages': self.func_add_languages,
+ 'dependency': self.func_dependency,
'executable': self.func_executable,
'jar': self.func_jar,
'library': self.func_library,
@@ -129,6 +131,16 @@ class IntrospectionInterpreter(AstInterpreter):
if lang not in self.coredata.compilers:
self.environment.detect_compilers(lang, need_cross_compiler)
+ def func_dependency(self, node, args, kwargs):
+ args = self.flatten_args(args)
+ if not args:
+ return
+ name = args[0]
+ self.dependencies += [{
+ 'name': name,
+ 'node': node
+ }]
+
def build_target(self, node, args, kwargs, targetclass):
if not args:
return