diff options
author | GabrĂel ArthĂșr PĂ©tursson <gabriel@system.is> | 2017-08-06 22:02:45 +0000 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2017-08-13 21:24:28 +0300 |
commit | 0ad448f89009e87fc3f22a85b0af53de5ebf8355 (patch) | |
tree | ba6a32fc69acda2f7ddd2259a7c2fb8d90cab7ed /mesonbuild/compilers/c.py | |
parent | 556966003ebd95c275b8d2c889c1d8ac339f3d36 (diff) | |
download | meson-0ad448f89009e87fc3f22a85b0af53de5ebf8355.zip meson-0ad448f89009e87fc3f22a85b0af53de5ebf8355.tar.gz meson-0ad448f89009e87fc3f22a85b0af53de5ebf8355.tar.bz2 |
Pass -fpch-preprocess to GCC when precompiled headers are used
CCache requires this flag when building with precompiled headers.
Without it, the preprocessor fails and CCache fallbacks to running the
real compiler.
Users still need to set 'sloppiness' to 'pch_defines,time_macros' in
their ccache.conf file for CCache to cache builds that use precompiled
headers. See the CCache manual for more info:
https://ccache.samba.org/manual.html#_precompiled_headers
Diffstat (limited to 'mesonbuild/compilers/c.py')
-rw-r--r-- | mesonbuild/compilers/c.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index 018c353..ec16134 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -777,6 +777,9 @@ class GnuCCompiler(GnuCompiler, CCompiler): def get_std_shared_lib_link_args(self): return ['-shared'] + def get_pch_use_args(self, pch_dir, header): + return ['-fpch-preprocess', '-include', os.path.split(header)[-1]] + class IntelCCompiler(IntelCompiler, CCompiler): def __init__(self, exelist, version, icc_type, is_cross, exe_wrapper=None): |