1
0
Fork 0
mirror of https://github.com/yshui/picom.git synced 2025-02-10 15:45:57 -05:00

meson: fix meson warnings

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2022-08-17 17:55:53 +00:00
parent ec9243cf3c
commit affe408d76
No known key found for this signature in database
GPG key ID: D3A4405BE6CC17F4

View file

@ -1,5 +1,5 @@
project('picom', 'c', version: '9', project('picom', 'c', version: '9',
default_options: ['c_std=c11']) default_options: ['c_std=c11', 'warning_level=1'])
cc = meson.get_compiler('c') cc = meson.get_compiler('c')
@ -9,7 +9,7 @@ version = 'v'+meson.project_version()
# use git describe if that's available # use git describe if that's available
git = find_program('git', required: false) git = find_program('git', required: false)
if git.found() if git.found()
gitv = run_command('git', 'rev-parse', '--short=5', 'HEAD') gitv = run_command('git', 'rev-parse', '--short=5', 'HEAD', check: false)
if gitv.returncode() == 0 if gitv.returncode() == 0
version = 'vgit-'+gitv.stdout().strip() version = 'vgit-'+gitv.stdout().strip()
endif endif
@ -53,7 +53,8 @@ if cc.has_header('stdc-predef.h')
add_global_arguments('-DHAS_STDC_PREDEF_H', language: 'c') add_global_arguments('-DHAS_STDC_PREDEF_H', language: 'c')
endif endif
warns = [ 'all', 'cast-function-type', 'ignored-qualifiers', 'missing-parameter-type', if get_option('warning_level') != '0'
warns = [ 'cast-function-type', 'ignored-qualifiers', 'missing-parameter-type',
'nonnull', 'shadow', 'no-type-limits', 'old-style-declaration', 'override-init', 'nonnull', 'shadow', 'no-type-limits', 'old-style-declaration', 'override-init',
'sign-compare', 'type-limits', 'uninitialized', 'shift-negative-value', 'sign-compare', 'type-limits', 'uninitialized', 'shift-negative-value',
'unused-but-set-parameter', 'unused-parameter', 'implicit-fallthrough', 'unused-but-set-parameter', 'unused-parameter', 'implicit-fallthrough',
@ -63,6 +64,7 @@ foreach w : warns
add_global_arguments('-W'+w, language: 'c') add_global_arguments('-W'+w, language: 'c')
endif endif
endforeach endforeach
endif
test_h_dep = subproject('test.h').get_variable('test_h_dep') test_h_dep = subproject('test.h').get_variable('test_h_dep')