From fce7b27e0a1e69decdef07e751de06089ed63123 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 2 May 2023 16:24:11 -0400 Subject: Replace strict option with new meson warning level --- meson/suppressions/meson.build | 44 +++++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 13 deletions(-) (limited to 'meson/suppressions/meson.build') diff --git a/meson/suppressions/meson.build b/meson/suppressions/meson.build index b3884c18..3d6fb28f 100644 --- a/meson/suppressions/meson.build +++ b/meson/suppressions/meson.build @@ -1,11 +1,9 @@ -# Copyright 2020-2022 David Robillard +# Copyright 2020-2023 David Robillard # SPDX-License-Identifier: 0BSD OR GPL-3.0-or-later -# Project-specific warning suppressions. -# -# This should be used in conjunction with the generic "warnings" sibling that -# enables all reasonable warnings for the compiler. It lives here just to keep -# the top-level meson.build more readable. +# Project-specific warning suppressions + +warning_level = get_option('warning_level') ####### # C++ # @@ -14,10 +12,12 @@ if is_variable('cpp') cpp_suppressions = [] - if get_option('strict') - if cpp.get_id() == 'clang' + if cpp.get_id() == 'clang' + if warning_level == 'everything' cpp_suppressions = [ '-Wno-c++17-extensions', + '-Wno-c++98-compat', + '-Wno-c++98-compat-pedantic', '-Wno-cast-align', '-Wno-cast-qual', '-Wno-documentation-unknown-command', @@ -27,19 +27,22 @@ if is_variable('cpp') '-Wno-format-nonliteral', '-Wno-global-constructors', '-Wno-implicit-float-conversion', - '-Wno-nullability-extension', '-Wno-padded', '-Wno-reserved-id-macro', '-Wno-shorten-64-to-32', '-Wno-sign-conversion', '-Wno-switch-enum', '-Wno-unreachable-code', - '-Wno-unused-parameter', '-Wno-vla', - '-Wno-vla-extension', '-Wno-weak-vtables', ] + if not meson.is_cross_build() + cpp_suppressions += [ + '-Wno-poison-system-directories', + ] + endif + if host_machine.system() in ['darwin', 'freebsd'] cpp_suppressions += [ '-Wno-comma', # boost @@ -56,8 +59,18 @@ if is_variable('cpp') '-Wno-zero-as-null-pointer-constant', # boost ] endif + endif + + if warning_level in ['everything', '3'] + cpp_suppressions += [ + '-Wno-unused-parameter', + '-Wno-vla-extension', + '-Wno-nullability-extension', + ] + endif - elif cpp.get_id() == 'gcc' + elif cpp.get_id() == 'gcc' + if warning_level == 'everything' cpp_suppressions = [ '-Wno-abi-tag', '-Wno-alloc-zero', @@ -90,8 +103,13 @@ if is_variable('cpp') '-Wno-switch-enum', '-Wno-unreachable-code', '-Wno-unused-const-variable', - '-Wno-unused-parameter', '-Wno-useless-cast', + ] + endif + + if warning_level in ['everything', '3'] + cpp_suppressions += [ + '-Wno-unused-parameter', '-Wno-vla', ] endif -- cgit v1.2.1