summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorMathieu Duponchelle <mathieu@centricular.com>2018-03-01 19:07:42 +0100
committerMathieu Duponchelle <mathieu@centricular.com>2018-03-01 19:24:30 +0100
commit7ce5d16b5cf1fb96c85f08edd2c577557a8affa9 (patch)
tree0a5081ad993c5237e4917c353570b27b97605243 /meson.build
parent83c38dc44622611c1f67dd26e4cb383c5aef90f6 (diff)
meson: enable more warnings
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build44
1 files changed, 44 insertions, 0 deletions
diff --git a/meson.build b/meson.build
index f2b2afa7..d97b0d99 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)
@@ -186,6 +188,48 @@ if gst_debug_disabled and cc.has_argument('-Wno-unused')
add_project_arguments('-Wno-unused', language: 'c')
endif
+warning_flags = [
+ '-Wmissing-declarations',
+ '-Wredundant-decls',
+ '-Wwrite-strings',
+ '-Wformat',
+ '-Wformat-nonliteral',
+ '-Wformat-security',
+ '-Winit-self',
+ '-Wmissing-include-dirs',
+ '-Waddress',
+ '-Wno-multichar',
+ '-Wvla',
+ '-Wpointer-arith',
+ '-Waggregate-return',
+]
+
+warning_c_flags = [
+ '-Wmissing-prototypes',
+ '-Wold-style-definition',
+ '-Wdeclaration-after-statement',
+ '-Wnested-externs'
+]
+
+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
+
presetdir = join_paths(get_option('datadir'), 'gstreamer-' + api_version, 'presets')
subdir('gst')
subdir('ext')