From e724fd5438a20836be1b270c1f851502ac97fdd4 Mon Sep 17 00:00:00 2001 From: Daniel Mensinger Date: Sat, 2 Mar 2019 17:41:25 +0100 Subject: rewriter: Handle duplicate target --- mesonbuild/ast/introspection.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mesonbuild/ast/introspection.py') diff --git a/mesonbuild/ast/introspection.py b/mesonbuild/ast/introspection.py index 12cb379..5745d29 100644 --- a/mesonbuild/ast/introspection.py +++ b/mesonbuild/ast/introspection.py @@ -194,7 +194,7 @@ class IntrospectionInterpreter(AstInterpreter): empty_sources = [] # Passing the unresolved sources list causes errors target = targetclass(name, self.subdir, self.subproject, is_cross, empty_sources, objects, self.environment, kwargs_reduced) - self.targets += [{ + new_target = { 'name': target.get_basename(), 'id': target.get_id(), 'type': target.get_typename(), @@ -206,9 +206,10 @@ class IntrospectionInterpreter(AstInterpreter): 'sources': source_nodes, 'kwargs': kwargs, 'node': node, - }] + } - return + self.targets += [new_target] + return new_target def build_library(self, node, args, kwargs): default_library = self.coredata.get_builtin_option('default_library') -- cgit v1.1