diff options
author | Christoph Reiter <reiter.christoph@gmail.com> | 2018-12-15 12:18:04 +0100 |
---|---|---|
committer | Christoph Reiter <reiter.christoph@gmail.com> | 2018-12-18 21:39:33 +0000 |
commit | 60f78f7e9e984802290a483535db208152008472 (patch) | |
tree | 181e3d60c8c9fda5066b11119488f09b81838eee /girepository/meson.build | |
parent | 5d00d872012a20ce3e7bd6421d81780fd9a09e52 (diff) | |
download | gobject-introspection-60f78f7e9e984802290a483535db208152008472.tar.gz |
meson: add default compiler warning flags and enable -Werror on CI
This enables various compiler warnings project wide and disables the triggered
ones for each library/executable. This should give us roughly the same behaviour
as with autotools.
Tested with gcc8 and clang7.
Diffstat (limited to 'girepository/meson.build')
-rw-r--r-- | girepository/meson.build | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/girepository/meson.build b/girepository/meson.build index 64cd9ece..e0f224e7 100644 --- a/girepository/meson.build +++ b/girepository/meson.build @@ -1,9 +1,14 @@ subdir('cmph') +custom_c_args = cc.get_supported_arguments([ + '-Wno-strict-prototypes', + '-Wno-old-style-definition', + '-Wno-cast-align', +]) girepo_gthash_lib = static_library('girepository-gthash', sources: 'gthash.c', include_directories : configinc, - c_args: gi_hidden_visibility_cflags, + c_args: gi_hidden_visibility_cflags + custom_c_args, dependencies: [ cmph_dep, glib_dep, @@ -17,6 +22,11 @@ girepo_gthash_dep = declare_dependency( include_directories: include_directories('.'), ) +custom_c_args = cc.get_supported_arguments([ + '-Wno-unused-parameter', + '-Wno-duplicated-branches', + '-Wno-cast-align', +]) girepo_internals_lib = static_library('girepository-internals', sources: [ 'girmodule.c', @@ -25,7 +35,7 @@ girepo_internals_lib = static_library('girepository-internals', 'girparser.c', 'girwriter.c', ], - c_args: gi_hidden_visibility_cflags, + c_args: gi_hidden_visibility_cflags + custom_c_args, include_directories : configinc, dependencies: [girepo_gthash_dep, libffi_dep], ) @@ -136,10 +146,18 @@ girepo_gir_sources = files( install_headers(girepo_headers, subdir: 'gobject-introspection-1.0') +custom_c_args = cc.get_supported_arguments([ + '-Wno-unused-parameter', + '-Wno-duplicated-branches', + '-Wno-type-limits', + '-Wno-cast-align', + '-Wno-missing-field-initializers', +]) girepo_lib = shared_library('girepository-1.0', sources: girepo_sources, include_directories : configinc, - c_args: gi_hidden_visibility_cflags + ['-DG_IREPOSITORY_COMPILATION'], + c_args: gi_hidden_visibility_cflags + ['-DG_IREPOSITORY_COMPILATION'] + + custom_c_args, dependencies: [glib_dep, gobject_dep, gmodule_dep, gio_dep, girepo_internals_dep], version: '1.0.0', |