mirror of
https://github.com/yshui/picom.git
synced 2024-11-18 13:55:36 -05:00
meson: fix meson warnings
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
parent
ec9243cf3c
commit
affe408d76
1 changed files with 14 additions and 12 deletions
26
meson.build
26
meson.build
|
@ -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,16 +53,18 @@ 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'
|
||||||
'nonnull', 'shadow', 'no-type-limits', 'old-style-declaration', 'override-init',
|
warns = [ 'cast-function-type', 'ignored-qualifiers', 'missing-parameter-type',
|
||||||
'sign-compare', 'type-limits', 'uninitialized', 'shift-negative-value',
|
'nonnull', 'shadow', 'no-type-limits', 'old-style-declaration', 'override-init',
|
||||||
'unused-but-set-parameter', 'unused-parameter', 'implicit-fallthrough',
|
'sign-compare', 'type-limits', 'uninitialized', 'shift-negative-value',
|
||||||
'no-unknown-warning-option', 'no-missing-braces', 'conversion', 'empty-body' ]
|
'unused-but-set-parameter', 'unused-parameter', 'implicit-fallthrough',
|
||||||
foreach w : warns
|
'no-unknown-warning-option', 'no-missing-braces', 'conversion', 'empty-body' ]
|
||||||
if cc.has_argument('-W'+w)
|
foreach w : warns
|
||||||
add_global_arguments('-W'+w, language: 'c')
|
if cc.has_argument('-W'+w)
|
||||||
endif
|
add_global_arguments('-W'+w, language: 'c')
|
||||||
endforeach
|
endif
|
||||||
|
endforeach
|
||||||
|
endif
|
||||||
|
|
||||||
test_h_dep = subproject('test.h').get_variable('test_h_dep')
|
test_h_dep = subproject('test.h').get_variable('test_h_dep')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue