From 47db4e3d53f3bdf624e63f6d890c01d5a0a0fb51 Mon Sep 17 00:00:00 2001 From: Martin Ejdestig Date: Mon, 22 Feb 2016 18:57:07 +0100 Subject: [PATCH] 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. --- mesonbuild/backend/backends.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py index 8256cee03..a354d6e1e 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()]