aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/backend/ninjabackend.py
diff options
context:
space:
mode:
authorGabrĂ­el ArthĂșr PĂ©tursson <gabriel@system.is>2017-07-06 22:13:32 +0000
committerJussi Pakkanen <jpakkane@gmail.com>2017-07-24 00:11:27 +0300
commit3ddf9bf6dd45c2accb526dbd97919c19ade43c25 (patch)
tree2a6c3a5946f59dc6788bf92a5d7004159a307e67 /mesonbuild/backend/ninjabackend.py
parent3bb1ba873b2e8cfd3be0d7c498e166c4817a0dce (diff)
downloadmeson-3ddf9bf6dd45c2accb526dbd97919c19ade43c25.zip
meson-3ddf9bf6dd45c2accb526dbd97919c19ade43c25.tar.gz
meson-3ddf9bf6dd45c2accb526dbd97919c19ade43c25.tar.bz2
Ensure same compiler flags are used for compiling PCH as normal sources
Precompiled headers should generally be compiled with the same flags as the sources that will include the header. Some deviations are safe, however, most will cause the compiler to reject the precompiled header or possibly lead to compiler crashes.
Diffstat (limited to 'mesonbuild/backend/ninjabackend.py')
-rw-r--r--mesonbuild/backend/ninjabackend.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index d169c84..5fc6d6b 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -211,9 +211,10 @@ int dummy;
# http://clang.llvm.org/docs/JSONCompilationDatabase.html
def generate_compdb(self):
ninja_exe = environment.detect_ninja()
+ pch_compilers = ['%s_PCH' % i for i in self.build.compilers]
native_compilers = ['%s_COMPILER' % i for i in self.build.compilers]
cross_compilers = ['%s_CROSS_COMPILER' % i for i in self.build.cross_compilers]
- ninja_compdb = [ninja_exe, '-t', 'compdb'] + native_compilers + cross_compilers
+ ninja_compdb = [ninja_exe, '-t', 'compdb'] + pch_compilers + native_compilers + cross_compilers
builddir = self.environment.get_build_dir()
try:
jsondb = subprocess.check_output(ninja_compdb, cwd=builddir)
@@ -2193,8 +2194,7 @@ rule FORTRAN_DEP_HACK
return commands, dep, dst, [objname]
def generate_gcc_pch_command(self, target, compiler, pch):
- commands = []
- commands += self.generate_basic_compiler_args(target, compiler)
+ commands = self._generate_single_compile(target, compiler)
dst = os.path.join(self.get_target_private_dir(target),
os.path.split(pch)[-1] + '.' + compiler.get_pch_suffix())
dep = dst + '.' + compiler.get_depfile_suffix()