1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-29 11:21:22 +03:00

meson: fix warnings in build files

meson prefers that project-level options for Wall/Wextra/pedantic be
used, rather than hardcoding raw flags in add_project_arguments. If you
do the latter anyway, it raises a meson warning.

Set the default options for the project to use all this.

Also move the -Werror comment to the project default options with
appropriate format, but leave it commented out since it does not work.
This commit is contained in:
Eli Schwartz
2021-08-08 21:11:20 -04:00
parent ee3355df30
commit d95a3f5097
2 changed files with 7 additions and 5 deletions

View File

@ -14,7 +14,11 @@ project('zstd',
default_options : [
'c_std=gnu99',
'cpp_std=c++11',
'buildtype=release'
'buildtype=release',
'warning_level=3',
# -Wdocumentation does not actually pass, nor do the test binaries,
# so this isn't safe
#'werror=true'
],
version: 'DUMMY',
meson_version: '>=0.47.0')
@ -106,10 +110,8 @@ use_lz4 = lz4_dep.found()
add_project_arguments('-DXXH_NAMESPACE=ZSTD_', language: ['c'])
if [compiler_gcc, compiler_clang].contains(cc_id)
common_warning_flags = [ '-Wextra', '-Wundef', '-Wshadow', '-Wcast-align', '-Wcast-qual' ]
common_warning_flags = [ '-Wundef', '-Wshadow', '-Wcast-align', '-Wcast-qual' ]
if cc_id == compiler_clang
# Should use Meson's own --werror build option
#common_warning_flags += '-Werror'
common_warning_flags += ['-Wconversion', '-Wno-sign-conversion', '-Wdocumentation']
endif
cc_compile_flags = cc.get_supported_arguments(common_warning_flags + ['-Wstrict-prototypes'])