Test for recursive instantiations of subprojects.

pull/15/head
Jussi Pakkanen 11 years ago
parent 2444eb357e
commit e0c4447666
  1. 4
      interpreter.py
  2. 3
      test cases/failing/8 recursive/meson.build
  3. 3
      test cases/failing/8 recursive/subprojects/a/meson.build
  4. 3
      test cases/failing/8 recursive/subprojects/b/meson.build

@ -797,7 +797,7 @@ class Interpreter():
if self.subdir != '':
raise InterpreterException('Subprojects must be defined at the root directory.')
if dirname in self.subproject_stack:
fullstack = self.subdir_stack + [dirname]
fullstack = self.subproject_stack + [dirname]
incpath = ' => '.join(fullstack)
raise InterpreterException('Recursive include of subprojects: %s.' % incpath)
if dirname == self.subprojects:
@ -809,7 +809,7 @@ class Interpreter():
self.global_flags_frozen = True
mlog.log('\nExecuting subproject ', mlog.bold(dirname), '.\n', sep='')
subi = Interpreter(self.build, subdir)
subi.subproject_stack = self.subproject_stack + [subdir]
subi.subproject_stack = self.subproject_stack + [dirname]
subi.run()
mlog.log('\nSubproject', mlog.bold(dirname), 'finished.')
self.build.subprojects[dirname] = True

@ -0,0 +1,3 @@
project('recursive', 'c')
a = subproject('a')

@ -0,0 +1,3 @@
project('a', 'c')
b = subproject('b')

@ -0,0 +1,3 @@
project('b', 'c')
a = subproject('a')
Loading…
Cancel
Save