aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/markdown/Builtin-options.md4
-rw-r--r--mesonbuild/backend/ninjabackend.py4
2 files changed, 7 insertions, 1 deletions
diff --git a/docs/markdown/Builtin-options.md b/docs/markdown/Builtin-options.md
index 3ab2380..288bd79 100644
--- a/docs/markdown/Builtin-options.md
+++ b/docs/markdown/Builtin-options.md
@@ -15,6 +15,8 @@ these can be set by passing to `meson` (aka `meson setup`) in any of
these ways: `--option=value`, `--option value`, `-Doption=value`, or
by setting them inside `default_options` of `project()` in your `meson.build`.
+For legacy reasons `--warnlevel` is the cli argument for the `warning_level` option.
+
They can also be edited after setup using `meson configure`.
Installation options are all relative to the prefix, except:
@@ -38,7 +40,7 @@ Installation options are all relative to the prefix, except:
| localstatedir | var | Localstate data directory |
| sharedstatedir | com | Architecture-independent data directory |
| werror | false | Treat warnings as errors |
-| warnlevel {1, 2, 3} | 1 | Set the warning level. From 1 = lowest to 3 = highest |
+| warning_level {1, 2, 3} | 1 | Set the warning level. From 1 = lowest to 3 = highest |
| layout {mirror,flat} | mirror | Build directory layout. |
| default-library {shared, static, both} | shared | Default library type. |
| backend {ninja, vs,<br>vs2010, vs2015, vs2017, xcode} | | Backend to use (default: ninja). |
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py
index 5d59fa9..372d7c2 100644
--- a/mesonbuild/backend/ninjabackend.py
+++ b/mesonbuild/backend/ninjabackend.py
@@ -2184,6 +2184,10 @@ rule FORTRAN_DEP_HACK%s
def generate_gcc_pch_command(self, target, compiler, pch):
commands = self._generate_single_compile(target, compiler)
+ if pch.split('.')[-1] == 'h' and compiler.language == 'cpp':
+ # Explicitly compile pch headers as C++. If Clang is invoked in C++ mode, it actually warns if
+ # this option is not set, and for gcc it also makes sense to use it.
+ commands += ['-x', 'c++-header']
dst = os.path.join(self.get_target_private_dir(target),
os.path.basename(pch) + '.' + compiler.get_pch_suffix())
dep = dst + '.' + compiler.get_depfile_suffix()