mirror of
https://github.com/systemd/systemd.git
synced 2024-10-27 10:25:37 +03:00
meson: fix detection of "-Wno-" options
This commit is contained in:
parent
9f0e9c0119
commit
2c5434ad3c
15
meson.build
15
meson.build
@ -246,10 +246,6 @@ foreach arg : ['-Wundef',
|
||||
'-Wendif-labels',
|
||||
'-Wstrict-aliasing=2',
|
||||
'-Wwrite-strings',
|
||||
'-Wno-unused-parameter',
|
||||
'-Wno-missing-field-initializers',
|
||||
'-Wno-unused-result',
|
||||
'-Wno-format-signedness',
|
||||
'-Werror=overflow',
|
||||
'-Wdate-time',
|
||||
'-Wnested-externs',
|
||||
@ -268,6 +264,17 @@ foreach arg : ['-Wundef',
|
||||
endif
|
||||
endforeach
|
||||
|
||||
# "negative" arguments: gcc on purpose does not return an error for "-Wno-"
|
||||
# arguments, just emits a warnings. So test for the "positive" version instead.
|
||||
foreach arg : ['unused-parameter',
|
||||
'missing-field-initializers',
|
||||
'unused-result',
|
||||
'format-signedness']
|
||||
if cc.has_argument('-W' + arg)
|
||||
add_project_arguments('-Wno-' + arg, language : 'c')
|
||||
endif
|
||||
endforeach
|
||||
|
||||
if cc.compiles('
|
||||
#include <time.h>
|
||||
#include <inttypes.h>
|
||||
|
Loading…
Reference in New Issue
Block a user