summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu@centricular.com>2018-03-01 18:16:24 +0100
committerMathieu Duponchelle <mathieu@centricular.com>2018-03-01 18:16:41 +0100
commit43e758cdb1fae78cd7072c70197800f3eef0ab71 (patch)
treec787de8437efa110e434f9883591f3bcddff1945
parent273d2c23d9cc43835a4efca3d1e092b446a13aeb (diff)
meson: enable more warnings
https://bugzilla.gnome.org/show_bug.cgi?id=793961
-rw-r--r--meson.build39
1 files changed, 39 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index d4a0b3cd3..8617d0269 100644
--- a/meson.build
+++ b/meson.build
@@ -15,6 +15,8 @@ else
gst_version_nano = 0
endif
+have_cxx = add_languages('cpp', required : false)
+
glib_req = '>= 2.40.0'
gst_req = '>= @0@.@1@.0'.format(gst_version_major, gst_version_minor)
@@ -143,6 +145,43 @@ cdata.set('GST_LICENSE', '"LGPL"')
cdata.set('PACKAGE', '"gst-plugins-good"')
cdata.set('GETTEXT_PACKAGE', '"gst-plugins-good-1.0"')
+warning_flags = [
+ '-Wmissing-declarations',
+ '-Wredundant-decls',
+ '-Wwrite-strings',
+ '-Winit-self',
+ '-Wmissing-include-dirs',
+ '-Wno-multichar',
+ '-Wvla',
+ '-Wpointer-arith',
+]
+
+warning_c_flags = [
+ '-Wmissing-prototypes',
+ '-Wdeclaration-after-statement',
+ '-Wold-style-definition',
+ '-Waggregate-return',
+]
+
+if have_cxx
+ cxx = meson.get_compiler('cpp')
+endif
+
+foreach extra_arg : warning_flags
+ if cc.has_argument (extra_arg)
+ add_project_arguments([extra_arg], language: 'c')
+ endif
+ if have_cxx and cxx.has_argument (extra_arg)
+ add_project_arguments([extra_arg], language: 'cpp')
+ endif
+endforeach
+
+foreach extra_arg : warning_c_flags
+ if cc.has_argument (extra_arg)
+ add_project_arguments([extra_arg], language: 'c')
+ endif
+endforeach
+
# GStreamer package name and origin url
gst_package_name = get_option('with-package-name')
if gst_package_name == ''