aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/compilers/objc.py
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2022-07-01 12:57:56 -0400
committerEli Schwartz <eschwartz93@gmail.com>2022-11-27 16:50:48 -0500
commit81d7c24a59bf4a991fe57579aa11a32b32779680 (patch)
tree4f294ec479ddb90506d4ef84bdb8d4d0493641d3 /mesonbuild/compilers/objc.py
parent9751c1fe61c34ea1a9e6a47cae251574586faff5 (diff)
downloadmeson-81d7c24a59bf4a991fe57579aa11a32b32779680.zip
meson-81d7c24a59bf4a991fe57579aa11a32b32779680.tar.gz
meson-81d7c24a59bf4a991fe57579aa11a32b32779680.tar.bz2
Add warning_level=everything
Adds a new maximum warning level that is roughly equivalent to "all warnings". This adds a way to use `/Wall` with MSVC (without the previous broken warning), `-Weverything` with clang, and almost all general warnings in GCC with strictness roughly equivalent to clang's `-Weverything`. The GCC case must be implemented by meson since GCC doesn't provide a similar option. To avoid maintenance headaches for meson, this warning level is defined objectively: all warnings are included except those that require specific values or are specific to particular language revisions. This warning level is mainly intended for new code, and it is expected (nearly guaranteed) that projects will need to add some suppressions to build cleanly with it. More commonly, it's just a handy way to occasionally take a look at what warnings are present with some compiler, in case anything interesting shows up you might want to enable in general. Since the warnings enabled at this level are inherently unstable with respect to compiler versions, it is intended for use by developers and not to be set as the default.
Diffstat (limited to 'mesonbuild/compilers/objc.py')
-rw-r--r--mesonbuild/compilers/objc.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/mesonbuild/compilers/objc.py b/mesonbuild/compilers/objc.py
index fc82e15..83dcaad 100644
--- a/mesonbuild/compilers/objc.py
+++ b/mesonbuild/compilers/objc.py
@@ -20,7 +20,7 @@ from ..mesonlib import OptionKey
from .compilers import Compiler
from .mixins.clike import CLikeCompiler
-from .mixins.gnu import GnuCompiler
+from .mixins.gnu import GnuCompiler, gnu_common_warning_args, gnu_objc_warning_args
from .mixins.clang import ClangCompiler
if T.TYPE_CHECKING:
@@ -68,7 +68,10 @@ class GnuObjCCompiler(GnuCompiler, ObjCCompiler):
self.warn_args = {'0': [],
'1': default_warn_args,
'2': default_warn_args + ['-Wextra'],
- '3': default_warn_args + ['-Wextra', '-Wpedantic']}
+ '3': default_warn_args + ['-Wextra', '-Wpedantic'],
+ 'everything': (default_warn_args + ['-Wextra', '-Wpedantic'] +
+ self.supported_warn_args(gnu_common_warning_args) +
+ self.supported_warn_args(gnu_objc_warning_args))}
class ClangObjCCompiler(ClangCompiler, ObjCCompiler):
@@ -85,7 +88,8 @@ class ClangObjCCompiler(ClangCompiler, ObjCCompiler):
self.warn_args = {'0': [],
'1': default_warn_args,
'2': default_warn_args + ['-Wextra'],
- '3': default_warn_args + ['-Wextra', '-Wpedantic']}
+ '3': default_warn_args + ['-Wextra', '-Wpedantic'],
+ 'everything': ['-Weverything']}
def get_options(self) -> 'coredata.MutableKeyedOptionDictType':
opts = super().get_options()