meson: enable more warnings

This commit is contained in:
Mathieu Duponchelle 2018-03-01 18:44:13 +01:00
parent a0cc9d1af0
commit 47208072bf
2 changed files with 51 additions and 1 deletions

View file

@ -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],

View file

@ -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 == ''