diff options
-rwxr-xr-x | interpreter.py | 4 | ||||
-rw-r--r-- | test cases/common/14 cpp pch/meson.build | 2 | ||||
-rw-r--r-- | test cases/common/14 cpp pch/pch/prog_pch.cc | 5 |
3 files changed, 9 insertions, 2 deletions
diff --git a/interpreter.py b/interpreter.py index da53cc2..36bb318 100755 --- a/interpreter.py +++ b/interpreter.py @@ -484,7 +484,9 @@ class BuildTarget(InterpreterObject): elif environment.is_source(pchlist[0]): if not environment.is_header(pchlist[1]): raise InterpreterException('PCH definition must contain one header and at most one source.') - pchlist = [pchlist[1], pchlist[0]] + pchlist = [pchlist[1], pchlist[0]] + else: + raise InterpreterException('PCH argument %s is of unknown type.' % pchlist[0]) elif len(pchlist) > 2: raise InterpreterException('PCH definition may have a maximum of 2 files.') self.pch[language] = pchlist diff --git a/test cases/common/14 cpp pch/meson.build b/test cases/common/14 cpp pch/meson.build index d56800b..6922fd7 100644 --- a/test cases/common/14 cpp pch/meson.build +++ b/test cases/common/14 cpp pch/meson.build @@ -1,2 +1,2 @@ project('c++ pch test', 'cpp') -exe = executable('prog', 'prog.cc', pch : 'pch/prog.hh') +exe = executable('prog', 'prog.cc', cpp_pch : ['pch/prog.hh', 'pch/prog_pch.cc']) diff --git a/test cases/common/14 cpp pch/pch/prog_pch.cc b/test cases/common/14 cpp pch/pch/prog_pch.cc new file mode 100644 index 0000000..aff1225 --- /dev/null +++ b/test cases/common/14 cpp pch/pch/prog_pch.cc @@ -0,0 +1,5 @@ +#if !defined(_MSC_VER) +#error "This file is only for use with MSVC." +#endif + +#include "prog.hh" |