meson.build: Silence the C99 designators warning
We use array designators for array initialization, which is a C99 extension. clang-10 warns about it, causing a build failure. As this is a useful extension, silence the warning. This needs to be done only if the compiler supports the -Wno-c99-designator argument, otherwise a -Wunknown-warning-option will be generated. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
@@ -60,6 +60,15 @@ if cc.get_id() == 'clang'
|
||||
endif
|
||||
endif
|
||||
|
||||
# We use C99 designated initializers for arrays as C++ has no equivalent
|
||||
# feature. Both gcc and clang support this extension, but recent
|
||||
# versions of clang generate a warning that needs to be disabled.
|
||||
if cc.has_argument('-Wno-c99-designator')
|
||||
common_arguments += [
|
||||
'-Wno-c99-designator',
|
||||
]
|
||||
endif
|
||||
|
||||
c_arguments += common_arguments
|
||||
cpp_arguments += common_arguments
|
||||
|
||||
|
||||
Reference in New Issue
Block a user