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
pull/2890/head
Matthias Klumpp 7 years ago
parent fd66692f73
commit 0da6d891ac
  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