aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/interpreter.py
diff options
context:
space:
mode:
Diffstat (limited to 'mesonbuild/interpreter.py')
-rw-r--r--mesonbuild/interpreter.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 8d64cc4..c2c4fe3 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -1735,8 +1735,16 @@ external dependencies (including libraries) must go to "dependencies".''')
return self.do_subproject(dirname, kwargs)
def do_subproject(self, dirname, kwargs):
- if '/' in dirname or '\\' in dirname:
- raise InterpreterException('Subproject name must not contain a path separator.')
+ if dirname == '':
+ raise InterpreterException('Subproject dir name must not be empty.')
+ if dirname[0] == '.':
+ raise InterpreterException('Subproject dir name must not start with a period.')
+ if '..' in dirname:
+ raise InterpreterException('Subproject name must not contain a ".." path segment.')
+ if os.path.isabs(dirname):
+ raise InterpreterException('Subproject name must not be an absolute path.')
+ if '\\' in dirname or '/' in dirname:
+ mlog.warning('Subproject name has a path separator. This may cause unexpected behaviour.')
if dirname in self.subproject_stack:
fullstack = self.subproject_stack + [dirname]
incpath = ' => '.join(fullstack)