aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Toohey <wtoohey@tritium.com.au>2021-11-16 14:33:36 +1000
committerNirbheek Chauhan <nirbheek@centricular.com>2021-11-25 21:10:18 +0530
commit9f19e6bd1cd9b133ed1de764ad170da9734092ae (patch)
tree4c290c7f69bcc582fed75b5acb27a23f6fde4391
parent0d139c6e79d8783db46ae9006b553b95ae3cb098 (diff)
downloadmeson-9f19e6bd1cd9b133ed1de764ad170da9734092ae.zip
meson-9f19e6bd1cd9b133ed1de764ad170da9734092ae.tar.gz
meson-9f19e6bd1cd9b133ed1de764ad170da9734092ae.tar.bz2
Support ancient (<3.4.0) gcc versions
-rw-r--r--mesonbuild/compilers/c.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py
index a01938c..9d4a779 100644
--- a/mesonbuild/compilers/c.py
+++ b/mesonbuild/compilers/c.py
@@ -245,6 +245,7 @@ class GnuCCompiler(GnuCompiler, CCompiler):
_C18_VERSION = '>=8.0.0'
_C2X_VERSION = '>=9.0.0'
+ _INVALID_PCH_VERSION = ">=3.4.0"
def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool,
info: 'MachineInfo', exe_wrapper: T.Optional['ExternalProgram'] = None,
@@ -253,7 +254,9 @@ class GnuCCompiler(GnuCompiler, CCompiler):
full_version: T.Optional[str] = None):
CCompiler.__init__(self, exelist, version, for_machine, is_cross, info, exe_wrapper, linker=linker, full_version=full_version)
GnuCompiler.__init__(self, defines)
- default_warn_args = ['-Wall', '-Winvalid-pch']
+ default_warn_args = ['-Wall']
+ if version_compare(self.version, self._INVALID_PCH_VERSION):
+ default_warn_args += ['-Winvalid-pch']
self.warn_args = {'0': [],
'1': default_warn_args,
'2': default_warn_args + ['-Wextra'],