meson: Use stricter C arguments to compile libfprint

These are based on what mutter does, being a quite strict project on c code
quality.
This commit is contained in:
Marco Trevisan (Treviño) 2019-12-04 14:27:33 +01:00
parent b2e55308d6
commit c678b9021c

View file

@ -21,20 +21,49 @@ glib_version_def = 'GLIB_VERSION_@0@_@1@'.format(
glib_min_version.split('.')[0], glib_min_version.split('.')[1]) glib_min_version.split('.')[0], glib_min_version.split('.')[1])
common_cflags = cc.get_supported_arguments([ common_cflags = cc.get_supported_arguments([
'-Wall', '-Wall',
'-Wcast-align',
'-Wformat-nonliteral',
'-Wformat-security',
'-Wformat=2',
'-Wignored-qualifiers',
'-Wlogical-op',
'-Wmissing-declarations',
'-Wmissing-format-attribute',
'-Wmissing-include-dirs',
'-Wmissing-noreturn',
'-Wpointer-arith',
'-Wshadow',
'-Wtype-limits', '-Wtype-limits',
'-Wundef', '-Wundef',
'-Wunused', '-Wunused',
'-Wstrict-prototypes', '-Werror=address',
'-Werror-implicit-function-declaration', '-Werror=array-bounds',
'-Wshadow', '-Werror=empty-body',
'-Werror=init-self',
'-Werror=int-to-pointer-cast',
'-Werror=main',
'-Werror=missing-braces',
'-Werror=nonnull',
'-Werror=redundant-decls',
'-Werror=return-type',
'-Werror=sequence-point',
'-Werror=trigraphs',
'-Werror=write-strings',
'-fno-strict-aliasing',
'-DGLIB_VERSION_MIN_REQUIRED=' + glib_version_def, '-DGLIB_VERSION_MIN_REQUIRED=' + glib_version_def,
'-DGLIB_VERSION_MAX_ALLOWED=' + glib_version_def, '-DGLIB_VERSION_MAX_ALLOWED=' + glib_version_def,
'-D_GNU_SOURCE', '-D_GNU_SOURCE',
'-DG_LOG_DOMAIN="libfprint"', '-DG_LOG_DOMAIN="libfprint"',
]) ])
c_cflags = cc.get_supported_arguments([ c_cflags = cc.get_supported_arguments([
'-fgnu89-inline',
'-std=gnu99', '-std=gnu99',
'-Wimplicit-function-declaration',
'-Wmissing-prototypes',
'-Wnested-externs',
'-Wold-style-definition',
'-Wstrict-prototypes',
'-Werror=implicit',
'-Werror=pointer-to-int-cast',
]) ])
add_project_arguments(common_cflags + c_cflags, language: 'c') add_project_arguments(common_cflags + c_cflags, language: 'c')
add_project_arguments(common_cflags, language: 'cpp') add_project_arguments(common_cflags, language: 'cpp')