From ff8a0418bb9dce1b91d08c3d9b955227485b498a Mon Sep 17 00:00:00 2001 From: Matthias Klumpp Date: Sun, 7 Jan 2018 18:14:51 +0100 Subject: [PATCH] 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 --- mesonbuild/interpreter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 268a8eff9..adf79664a 100644 --- a/mesonbuild/interpreter.py +++ b/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