diff options
| -rw-r--r-- | mesonbuild/backend/ninjabackend.py | 4 | ||||
| -rw-r--r-- | mesonbuild/interpreter/type_checking.py | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index 90c61a26b..603a512b2 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -3380,10 +3380,6 @@ https://gcc.gnu.org/bugzilla/show_bug.cgi?id=47485''')) pch = target.pch[lang] if not pch: continue - if not has_path_sep(pch[0]) or (pch[1] and has_path_sep(pch[1])): - msg = f'Precompiled header of {target.get_basename()!r} must not be in the same ' \ - 'directory as source, please put it in a subdirectory.' - raise InvalidArguments(msg) compiler: Compiler = target.compilers[lang] if compiler.get_argument_syntax() == 'msvc': (commands, dep, dst, objs, src) = self.generate_msvc_pch_command(target, compiler, pch) diff --git a/mesonbuild/interpreter/type_checking.py b/mesonbuild/interpreter/type_checking.py index 6cd43b7c6..b4799f3a7 100644 --- a/mesonbuild/interpreter/type_checking.py +++ b/mesonbuild/interpreter/type_checking.py @@ -671,6 +671,10 @@ def _pch_validator(args: T.List[str]) -> T.Optional[str]: return 'PCH files must be stored in the same folder.' elif num_args > 2: return 'A maximum of two elements are allowed for PCH arguments' + if num_args >= 1 and not has_path_sep(args[0]): + return f'PCH header {args[0]} must not be in the same directory as source files' + if num_args == 2 and not has_path_sep(args[1]): + return f'PCH source {args[0]} must not be in the same directory as source files' return None |
