Precompiled headers work for C++.

pull/15/head
Jussi Pakkanen 12 years ago
parent 4887450de6
commit 7e6d8454a4
  1. 4
      interpreter.py
  2. 2
      test cases/common/14 cpp pch/meson.build
  3. 5
      test cases/common/14 cpp pch/pch/prog_pch.cc

@ -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

@ -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'])

@ -0,0 +1,5 @@
#if !defined(_MSC_VER)
#error "This file is only for use with MSVC."
#endif
#include "prog.hh"
Loading…
Cancel
Save