Workaround for Clang pch include bug with help from Masashi Fujita.

pull/15/head
Jussi Pakkanen 10 years ago
parent 28ceaa650c
commit 0abc1b1bad
  1. 1
      authors.txt
  2. 13
      environment.py

@ -6,3 +6,4 @@ Meson was originally designed and created by Jussi Pakkanen.
The following people have submitted patches for the project The following people have submitted patches for the project
Peter Koval Peter Koval
Masashi Fujita

@ -1099,6 +1099,13 @@ class ClangCCompiler(CCompiler):
def can_compile(self, filename): def can_compile(self, filename):
return super().can_compile(filename) or filename.split('.')[-1] == 's' # Clang can do asm, too. return super().can_compile(filename) or filename.split('.')[-1] == 's' # Clang can do asm, too.
def get_pch_use_args(self, pch_dir, header):
# Workaround for Clang bug http://llvm.org/bugs/show_bug.cgi?id=15136
# This flag is internal to Clang (or at least not documented on the man page)
# so it might change semantics at any time.
return ['-include-pch', os.path.join (pch_dir, self.get_pch_name (header))]
class GnuCPPCompiler(CPPCompiler): class GnuCPPCompiler(CPPCompiler):
std_warn_args = ['-Wall', '-Winvalid-pch'] std_warn_args = ['-Wall', '-Winvalid-pch']
# may need to separate the latter to extra_debug_args or something # may need to separate the latter to extra_debug_args or something
@ -1149,6 +1156,12 @@ class ClangCPPCompiler(CPPCompiler):
def get_pch_suffix(self): def get_pch_suffix(self):
return 'pch' return 'pch'
def get_pch_use_args(self, pch_dir, header):
# Workaround for Clang bug http://llvm.org/bugs/show_bug.cgi?id=15136
# This flag is internal to Clang (or at least not documented on the man page)
# so it might change semantics at any time.
return ['-include-pch', os.path.join (pch_dir, self.get_pch_name (header))]
class FortranCompiler(): class FortranCompiler():
std_warn_args = ['-Wall'] std_warn_args = ['-Wall']

Loading…
Cancel
Save