mirror of
https://gitlab.freedesktop.org/emersion/libdisplay-info.git
synced 2024-12-26 21:59:15 +01:00
build: tweak C warning options
Enable a few extra warning options, including -Walloca because it's error-prone. Enable -Wdeclaration-after-statement to enforce the code style. Disable -Wunused-parameter and -Wmissing-field-initializers because these are pointless and don't catch bugs. Inspired from the Weston and wlroots options. Signed-off-by: Simon Ser <contact@emersion.fr>
This commit is contained in:
parent
79fbb1ec39
commit
a47a411617
1 changed files with 12 additions and 0 deletions
12
meson.build
12
meson.build
|
@ -9,3 +9,15 @@ project(
|
|||
'warning_level=3',
|
||||
],
|
||||
)
|
||||
|
||||
cc = meson.get_compiler('c')
|
||||
|
||||
add_project_arguments(cc.get_supported_arguments([
|
||||
'-Wundef',
|
||||
'-Wmissing-prototypes',
|
||||
'-Walloca',
|
||||
'-Wdeclaration-after-statement',
|
||||
|
||||
'-Wno-unused-parameter',
|
||||
'-Wno-missing-field-initializers',
|
||||
]), language: 'c')
|
||||
|
|
Loading…
Reference in a new issue