mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-28 05:02:10 +01:00
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.
This commit is contained in:
parent
cb1d599495
commit
13ba457c22
@ -29,9 +29,20 @@ cmph_deps = [
|
||||
cc.find_library('m', required: false),
|
||||
]
|
||||
|
||||
custom_c_args = cc.get_supported_arguments([
|
||||
'-Wno-implicit-fallthrough',
|
||||
'-Wno-old-style-definition',
|
||||
'-Wno-strict-prototypes',
|
||||
'-Wno-suggest-attribute=noreturn',
|
||||
'-Wno-type-limits',
|
||||
'-Wno-undef',
|
||||
'-Wno-unused-parameter',
|
||||
'-Wno-cast-align',
|
||||
'-Wno-unused-function',
|
||||
])
|
||||
cmph = static_library('cmph',
|
||||
sources: cmph_sources,
|
||||
c_args: gi_hidden_visibility_cflags,
|
||||
c_args: gi_hidden_visibility_cflags + custom_c_args,
|
||||
dependencies: cmph_deps,
|
||||
)
|
||||
|
||||
@ -40,11 +51,17 @@ cmph_dep = declare_dependency(
|
||||
include_directories: include_directories('.'),
|
||||
)
|
||||
|
||||
custom_c_args = cc.get_supported_arguments([
|
||||
'-Wno-old-style-definition',
|
||||
'-Wno-strict-prototypes',
|
||||
'-Wno-type-limits',
|
||||
])
|
||||
cmph_test = executable('cmph-bdz-test', '../cmph-bdz-test.c',
|
||||
dependencies: [
|
||||
cmph_dep,
|
||||
glib_dep,
|
||||
]
|
||||
],
|
||||
c_args: custom_c_args,
|
||||
)
|
||||
|
||||
test('cmph-bdz-test', cmph_test)
|
||||
|
24
meson.build
24
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',
|
||||
|
Loading…
x
Reference in New Issue
Block a user