diff --git a/meson.build b/meson.build index c0eac362..95903ab9 100644 --- a/meson.build +++ b/meson.build @@ -23,12 +23,13 @@ add_project_arguments( '-Werror=parentheses', '-Wformat-nonliteral', '-Wformat-security', + '-Wformat', '-Winit-self', '-Wmaybe-uninitialized', '-Wold-style-definition', '-Wredundant-decls', '-Wstrict-prototypes', - '-Wunused-function', + '-Wunused', ], language: 'c' ) @@ -40,6 +41,16 @@ conf_data = configuration_data() if get_option('buildtype').startswith('debug') add_project_arguments('-DDEBUG=1', language : 'c') endif + +if get_option('strict') + add_project_arguments( + [ + '-Werror', + ], + language: 'c' + ) +endif + if get_option('buildtype') != 'plain' add_project_arguments('-fstack-protector-strong', language: 'c') endif diff --git a/meson_options.txt b/meson_options.txt index 180f12f3..bb68374d 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -10,3 +10,7 @@ option('tests', option('legacy', type: 'boolean', value: false, description: 'Build with Deban Buster versions of dependencies') + +option('strict', + type: 'boolean', value: true, + description: 'Turn more warnings into errors')