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

pull/4988/head
Daniel Mensinger 6 years ago committed by Jussi Pakkanen
parent 8c6d6393f2
commit 4bf1a352cc
  1. 3
      mesonbuild/ast/introspection.py
  2. 6
      test cases/unit/53 introspect buildoptions/main.c
  3. 5
      test cases/unit/53 introspect buildoptions/meson.build

@ -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']

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

@ -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')

Loading…
Cancel
Save