summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu@centricular.com>2018-03-01 17:20:06 +0100
committerMathieu Duponchelle <mathieu@centricular.com>2018-03-01 17:20:48 +0100
commitd67623c7a9cd50e42f1b2e48d29b79e366aa00ef (patch)
tree4e66beb14f277fe32fc83a90303f0601650e2dd6 /meson.build
parent8c10f1e2b40b40c769c3cea520fd9b1ce3ce751e (diff)
meson: enable more warnings
Modeled on the autotools build, -W flags are only added if the compiler supports them. https://bugzilla.gnome.org/show_bug.cgi?id=793958
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build27
1 files changed, 26 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index 60a0a5dfb..7aa45de28 100644
--- a/meson.build
+++ b/meson.build
@@ -45,7 +45,6 @@ if cc.get_id() == 'msvc'
elif cc.has_argument('-Wl,-Bsymbolic-functions')
# FIXME: Add an option for this if people ask for it
add_project_link_arguments('-Wl,-Bsymbolic-functions', language : 'c')
- # FIXME: Add FATAL_WARNINGS from configure.ac
endif
# Symbol visibility
@@ -339,6 +338,32 @@ if disable_gst_debug
add_project_arguments(['-Wno-unused'], language: 'c')
endif
+warning_flags = [
+ '-Wmissing-declarations',
+ '-Wmissing-prototypes',
+ '-Wredundant-decls',
+ '-Wundef',
+ '-Wwrite-strings',
+ '-Wformat-nonliteral',
+ '-Wformat-security',
+ '-Wold-style-definition',
+ '-Winit-self',
+ '-Wmissing-include-dirs',
+ '-Waddress',
+ '-Waggregate-return',
+ '-Wno-multichar',
+ '-Wnested-externs',
+ '-Wdeclaration-after-statement',
+ '-Wvla',
+ '-Wpointer-arith',
+]
+
+foreach extra_arg : warning_flags
+ if cc.has_argument (extra_arg)
+ add_project_arguments([extra_arg], language: 'c')
+ endif
+endforeach
+
# Used by the gstutils test
gmp_dep = cc.find_library('gmp', required : false)
cdata.set('HAVE_GMP', gmp_dep.found())