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.
pull/404/head
Martin Ejdestig 9 years ago
parent d95a108503
commit 47db4e3d53
  1. 1
      mesonbuild/backend/backends.py

@ -241,7 +241,6 @@ class Backend():
def generate_basic_compiler_args(self, target, compiler): def generate_basic_compiler_args(self, target, compiler):
commands = [] commands = []
commands += compiler.get_always_args() 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 += compiler.get_option_compile_args(self.environment.coredata.compiler_options)
commands += self.build.get_global_args(compiler) commands += self.build.get_global_args(compiler)

Loading…
Cancel
Save