aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2014-10-18 14:01:27 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2014-10-18 14:08:13 +0300
commit0abc1b1badde962a99b924b3eec0a3398aa91697 (patch)
treef506b531573654c9fe4b81639572ee5c593c87ec
parent28ceaa650cc0944c04dc3cf9d7753671154b42dd (diff)
downloadmeson-0abc1b1badde962a99b924b3eec0a3398aa91697.zip
meson-0abc1b1badde962a99b924b3eec0a3398aa91697.tar.gz
meson-0abc1b1badde962a99b924b3eec0a3398aa91697.tar.bz2
Workaround for Clang pch include bug with help from Masashi Fujita.
-rw-r--r--authors.txt1
-rw-r--r--environment.py13
2 files changed, 14 insertions, 0 deletions
diff --git a/authors.txt b/authors.txt
index b247b05..2c6d8ea 100644
--- a/authors.txt
+++ b/authors.txt
@@ -6,3 +6,4 @@ Meson was originally designed and created by Jussi Pakkanen.
The following people have submitted patches for the project
Peter Koval
+Masashi Fujita
diff --git a/environment.py b/environment.py
index 1cf26ca..86bd4ef 100644
--- a/environment.py
+++ b/environment.py
@@ -1099,6 +1099,13 @@ class ClangCCompiler(CCompiler):
def can_compile(self, filename):
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):
std_warn_args = ['-Wall', '-Winvalid-pch']
# may need to separate the latter to extra_debug_args or something
@@ -1149,6 +1156,12 @@ class ClangCPPCompiler(CPPCompiler):
def get_pch_suffix(self):
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():
std_warn_args = ['-Wall']