Allow subproject dirs in subdirectories in the source tree again

The previous change disallowed any subdirectories for subproject dirs,
and therefore broke a couple of projects making use of that.
This change still prevents people from setting subproject dirs that are
not in the project's source tree, while allowing to specify any path
within the project's directory again.

Resolves: #2719
0.44
Matthias Klumpp 7 years ago committed by Nirbheek Chauhan
parent 33a900d4b9
commit ff8a0418bb
  1. 4
      mesonbuild/interpreter.py

@ -1883,8 +1883,8 @@ to directly access options of other subprojects.''')
raise InvalidCode('Second call to project().')
if not self.is_subproject() and 'subproject_dir' in kwargs:
spdirname = kwargs['subproject_dir']
if '/' in spdirname or '\\' in spdirname:
raise InterpreterException('Subproject_dir must not contain a path segment.')
if os.path.isabs(spdirname):
raise InterpreterException('Subproject_dir must not be an absolute path.')
if spdirname.startswith('.'):
raise InterpreterException('Subproject_dir must not begin with a period.')
self.subproject_dir = spdirname

Loading…
Cancel
Save