summaryrefslogtreecommitdiff
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
parenta0cc9d1af004376cbedd8dd230712c69cd203517 (diff)
meson: enable more warnings
-rw-r--r--ext/dts/meson.build6
-rw-r--r--meson.build46
2 files changed, 51 insertions, 1 deletions
diff --git a/ext/dts/meson.build b/ext/dts/meson.build
index 882a6aa89..6bbf95a6e 100644
--- a/ext/dts/meson.build
+++ b/ext/dts/meson.build
@@ -4,10 +4,14 @@ if not dca_dep.found() and cc.has_header_symbol('dca.h', 'dca_init')
dca_dep = cc.find_library('dca', required : false)
endif
+# autotools didn't use the libdca pkg-config cflags, and they
+# can point to a non-existing location (/usr/include/dca)
+no_warn_c_args = ['-Wno-missing-include-dirs']
+
if dca_dep.found()
gstdtsdec = library('gstdtsdec',
'gstdtsdec.c',
- c_args : gst_plugins_bad_args,
+ c_args : gst_plugins_bad_args + no_warn_c_args,
link_args : noseh_link_args,
include_directories : [configinc, libsinc],
dependencies : [gstaudio_dep, orc_dep, dca_dep],
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 == ''