build: rework -Wall and -Wextra declaration

Use warning_level instead of defining -Wall and -Wextra explicitly.

Fixes the following warning:

meson.build:235: WARNING: Consider using the built-in warning_level
option instead of using "-Wall".
This commit is contained in:
Yegor Yefremov
2024-02-17 08:50:24 +01:00
committed by Íñigo Huguet
parent d5c12a137b
commit b864eb2eb3

View File

@@ -11,6 +11,7 @@ project(
default_options: [ default_options: [
'buildtype=debugoptimized', 'buildtype=debugoptimized',
'c_std=gnu11', 'c_std=gnu11',
'warning_level=2' # value "2" will add "-Wall" and "-Wextra" to the compiler flags
], ],
meson_version: '>= 0.47.2', meson_version: '>= 0.47.2',
) )
@@ -173,8 +174,6 @@ if enable_lto
endif endif
common_flags += cc.get_supported_arguments([ common_flags += cc.get_supported_arguments([
'-Wall',
'-Wextra',
'-Wcast-align=strict', '-Wcast-align=strict',
'-Wdeclaration-after-statement', '-Wdeclaration-after-statement',
'-Wfloat-equal', '-Wfloat-equal',