From f7cde8d3f62c0ae0ef445698a407d1bdb2218cd6 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Fri, 8 Jul 2022 10:13:31 -0700 Subject: Add fatal=False to many mlog.warnings() There are lots of warnings that become fatal, that are simply unfixable by the end user. Things like using old versions of software (because they're using some kind of LTS release), warnings about compilers not supporting certain kinds of checks, or standards being upgraded due to skipped implementations (MSVC has c++98 and c++14, but not c++11). None of these should be fatal, they're informative, and too important to reduce to notices, but not important enough to stop meson if they're printed. --- mesonbuild/compilers/cpp.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'mesonbuild/compilers') diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index 7296626..5789bb5 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -59,7 +59,7 @@ def non_msvc_eh_options(eh: str, args: T.List[str]) -> None: args.append('-fno-exceptions') elif eh in {'s', 'c'}: mlog.warning(f'non-MSVC compilers do not support {eh} exception handling. ' - 'You may want to set eh to \'default\'.') + 'You may want to set eh to \'default\'.', fatal=False) class CPPCompiler(CLikeCompiler, Compiler): def attribute_check_func(self, name: str) -> str: @@ -692,7 +692,8 @@ class CPP11AsCPP14Mixin(CompilerMixinBase): key = OptionKey('std', machine=self.for_machine, lang=self.language) if options[key].value in {'vc++11', 'c++11'}: mlog.warning(self.id, 'does not support C++11;', - 'attempting best effort; setting the standard to C++14', once=True) + 'attempting best effort; setting the standard to C++14', + once=True, fatal=False) # Don't mutate anything we're going to change, we need to use # deepcopy since we're messing with members, and we can't simply # copy the members because the option proxy doesn't support it. @@ -732,7 +733,7 @@ class VisualStudioCPPCompiler(CPP11AsCPP14Mixin, VisualStudioLikeCPPCompilerMixi def get_option_compile_args(self, options: 'KeyedOptionDictType') -> T.List[str]: key = OptionKey('std', machine=self.for_machine, lang=self.language) if options[key].value != 'none' and version_compare(self.version, '<19.00.24210'): - mlog.warning('This version of MSVC does not support cpp_std arguments') + mlog.warning('This version of MSVC does not support cpp_std arguments', fatal=False) options = copy.copy(options) options[key].value = 'none' -- cgit v1.1