aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Ejdestig <marejde@gmail.com>2016-02-22 18:57:07 +0100
committerMartin Ejdestig <marejde@gmail.com>2016-02-22 18:57:07 +0100
commit47db4e3d53f3bdf624e63f6d890c01d5a0a0fb51 (patch)
tree416fe4f4ea039e448887ba51485c548a41a8e0e1
parentd95a1085031fd1deb24e8f3232e9052e598b2b4e (diff)
downloadmeson-47db4e3d53f3bdf624e63f6d890c01d5a0a0fb51.zip
meson-47db4e3d53f3bdf624e63f6d890c01d5a0a0fb51.tar.gz
meson-47db4e3d53f3bdf624e63f6d890c01d5a0a0fb51.tar.bz2
Pass warning arguments to compiler even if buildtype is plain
Noticed when trying to pass custom optimization flags, and hence setting buildtype to plain, that warnings for different levels were not passed to compiler. This was a bit confusing since mesonconf still displayed "warning_level=3" and -Werror was passed correctly due to "werror=true". So this change aligns warning_level behavior with werror. That is, heed what is in project() in meson.build but user can still override if necessary.
-rw-r--r--mesonbuild/backend/backends.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 8256cee..a354d6e 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -241,8 +241,7 @@ class Backend():
def generate_basic_compiler_args(self, target, compiler):
commands = []
commands += compiler.get_always_args()
- if self.environment.coredata.get_builtin_option('buildtype') != 'plain':
- commands += compiler.get_warn_args(self.environment.coredata.get_builtin_option('warning_level'))
+ commands += compiler.get_warn_args(self.environment.coredata.get_builtin_option('warning_level'))
commands += compiler.get_option_compile_args(self.environment.coredata.compiler_options)
commands += self.build.get_global_args(compiler)
commands += self.environment.coredata.external_args[compiler.get_language()]