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