Start of subproject redesign, moved subprojects to the dedicated subdirectory.

pull/15/head
Jussi Pakkanen 11 years ago
parent 836c978c94
commit 1f1a3f516e
  1. 8
      interpreter.py
  2. 0
      test cases/common/49 subproject/subprojects/sublib/include/subdefs.h
  3. 0
      test cases/common/49 subproject/subprojects/sublib/meson.build
  4. 0
      test cases/common/49 subproject/subprojects/sublib/simpletest.c
  5. 0
      test cases/common/49 subproject/subprojects/sublib/sublib.c
  6. 0
      test cases/common/50 subproject options/subprojects/subproject/meson.build
  7. 0
      test cases/common/50 subproject options/subprojects/subproject/meson_options.txt

@ -799,7 +799,7 @@ class Interpreter():
raise InterpreterException('Subprojects of subprojects are not yet supported.')
if dirname in self.build.subprojects:
raise InterpreterException('Tried to add the same subproject twice.')
subdir = os.path.join(self.subproject, self.subdir, dirname)
subdir = os.path.join('subprojects', dirname)
abs_subdir = os.path.join(self.build.environment.get_source_dir(), subdir)
if not os.path.isdir(abs_subdir):
raise InterpreterException('Subproject directory does not exist.')
@ -807,7 +807,7 @@ class Interpreter():
mlog.log('\nExecuting subproject ', mlog.bold(dirname), '.\n', sep='')
subi = Interpreter(self.build, subdir)
subi.run()
mlog.log('\nSubproject finished.\n')
mlog.log('\nSubproject', mlog.bold(dirname), 'finished.')
self.build.subprojects[dirname] = True
self.subprojects[dirname] = SubprojectHolder(subi)
return self.subprojects[dirname]
@ -995,6 +995,10 @@ class Interpreter():
if len(kwargs) > 0:
raise InvalidArguments('subdir command takes no keyword arguments.')
self.validate_arguments(args, 1, [str])
if '..' in args[0]:
raise InvalidArguments('Subdir contains ..')
if self.subdir == '' and args[0] == 'subprojects':
raise InvalidArguments('Must not go into subprojects dir with subdir(), use subproject() instead.')
prev_subdir = self.subdir
subdir = os.path.join(prev_subdir, args[0])
if subdir in self.visited_subdirs:

Loading…
Cancel
Save