mconf: Fixed crash for variables in targets (closes #4960)

This commit is contained in:
Daniel Mensinger 2019-02-22 11:30:29 +01:00 committed by Jussi Pakkanen
parent 8c6d6393f2
commit 4bf1a352cc
3 changed files with 13 additions and 1 deletions

View File

@ -142,10 +142,11 @@ class IntrospectionInterpreter(AstInterpreter):
}]
def build_target(self, node, args, kwargs, targetclass):
args = self.flatten_args(args)
if not args:
return
kwargs = self.flatten_kwargs(kwargs, True)
name = self.flatten_args(args)[0]
name = args[0]
srcqueue = [node]
if 'sources' in kwargs:
srcqueue += kwargs['sources']

View File

@ -0,0 +1,6 @@
#include <stdio.h>
int main() {
printf("Hello World");
return 0;
}

View File

@ -2,6 +2,11 @@ project('introspect buildargs', ['c'], default_options: ['c_std=c11', 'cpp_std=c
subA = subproject('projectA')
target_name = 'MAIN'
target_src = ['main.c']
executable(target_name, target_src)
r = run_command(find_program('c_compiler.py'))
if r.returncode() != 0
error('FAILED')