summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu@centricular.com>2018-03-01 18:44:13 +0100
committerMathieu Duponchelle <mathieu@centricular.com>2018-03-01 18:44:30 +0100
commit47208072bf5d7ce236621f94168ee0966982f2ea (patch)
tree395973aa12502c25a297a84e4a1acd22ab98e59a /meson.build
parenta0cc9d1af004376cbedd8dd230712c69cd203517 (diff)
downloadgstreamer-plugins-bad-47208072bf5d7ce236621f94168ee0966982f2ea.tar.gz
meson: enable more warnings
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build46
1 files changed, 46 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index 7a92ef4cb..88c4fa974 100644
--- a/meson.build
+++ b/meson.build
@@ -269,6 +269,52 @@ cdata.set_quoted('GST_API_VERSION', api_version)
cdata.set_quoted('GST_LICENSE', 'LGPL')
cdata.set_quoted('LIBDIR', join_paths(get_option('prefix'), get_option('libdir')))
+warning_flags = [
+ '-Wmissing-declarations',
+ '-Wredundant-decls',
+ '-Wwrite-strings',
+ '-Wformat',
+ '-Wformat-security',
+ '-Winit-self',
+ '-Wmissing-include-dirs',
+ '-Waddress',
+ '-Wno-multichar',
+ '-Wvla',
+ '-Wpointer-arith',
+]
+
+warning_c_flags = [
+ '-Wmissing-prototypes',
+ '-Wdeclaration-after-statement',
+ '-Wold-style-definition',
+ '-Wnested-externs',
+]
+
+warning_cxx_flags = [
+ '-Wformat-nonliteral',
+]
+
+foreach extra_arg : warning_c_flags
+ if cc.has_argument (extra_arg)
+ add_project_arguments([extra_arg], language: 'c')
+ endif
+endforeach
+
+foreach extra_arg : warning_cxx_flags
+ if cxx.has_argument (extra_arg)
+ add_project_arguments([extra_arg], language: 'cpp')
+ endif
+endforeach
+
+foreach extra_arg : warning_flags
+ if cc.has_argument (extra_arg)
+ add_project_arguments([extra_arg], language: 'c')
+ endif
+ if cxx.has_argument (extra_arg)
+ add_project_arguments([extra_arg], language: 'cpp')
+ endif
+endforeach
+
# GStreamer package name and origin url
gst_package_name = get_option('with-package-name')
if gst_package_name == ''