meson: fix -Wno-foo argument testing
gcc and clang ignore `-Wno-foo` arguments nowadays, so we need to test the positive variant instead.
This commit is contained in:
parent
0f9f86f4a4
commit
bc315aa288
13
meson.build
13
meson.build
@ -66,17 +66,24 @@ cc = meson.get_compiler('c')
|
|||||||
|
|
||||||
global_args = []
|
global_args = []
|
||||||
global_args_maybe = [
|
global_args_maybe = [
|
||||||
'-Wno-unused-parameter',
|
|
||||||
'-Wno-shift-negative-value', # required due to Pixman
|
|
||||||
'-Wno-missing-field-initializers',
|
|
||||||
'-fvisibility=hidden',
|
'-fvisibility=hidden',
|
||||||
'-DIN_WESTON',
|
'-DIN_WESTON',
|
||||||
]
|
]
|
||||||
|
global_wnoargs_maybe = [
|
||||||
|
'unused-parameter',
|
||||||
|
'shift-negative-value', # required due to Pixman
|
||||||
|
'missing-field-initializers',
|
||||||
|
]
|
||||||
foreach a : global_args_maybe
|
foreach a : global_args_maybe
|
||||||
if cc.has_argument(a)
|
if cc.has_argument(a)
|
||||||
global_args += a
|
global_args += a
|
||||||
endif
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
|
foreach a : global_wnoargs_maybe
|
||||||
|
if cc.has_argument('-W' + a)
|
||||||
|
global_args += '-Wno-' + a
|
||||||
|
endif
|
||||||
|
endforeach
|
||||||
add_global_arguments(global_args, language: 'c')
|
add_global_arguments(global_args, language: 'c')
|
||||||
|
|
||||||
if cc.has_header_symbol('sys/sysmacros.h', 'major')
|
if cc.has_header_symbol('sys/sysmacros.h', 'major')
|
||||||
|
Loading…
Reference in New Issue
Block a user