mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-14 05:12:09 +00:00
meson: Enable some MSVC warnings for parity with GCC/Clang
This makes it easier to do development with MSVC by making it warn on common issues that GCC/Clang error out for in our CI configuration. Continuation from https://gitlab.freedesktop.org/gstreamer/gst-build/-/merge_requests/223 Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/698>
This commit is contained in:
parent
e5e27010c8
commit
926652be10
1 changed files with 12 additions and 6 deletions
18
meson.build
18
meson.build
|
@ -36,18 +36,24 @@ cc = meson.get_compiler('c')
|
|||
|
||||
cdata = configuration_data()
|
||||
|
||||
# Ignore several spurious warnings for things gstreamer does very commonly
|
||||
# If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
|
||||
# If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once
|
||||
# NOTE: Only add warnings here if you are sure they're spurious
|
||||
if cc.get_id() == 'msvc'
|
||||
add_project_arguments(
|
||||
msvc_args = [
|
||||
# Ignore several spurious warnings for things gstreamer does very commonly
|
||||
# If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
|
||||
# If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once
|
||||
# NOTE: Only add warnings here if you are sure they're spurious
|
||||
'/wd4018', # implicit signed/unsigned conversion
|
||||
'/wd4146', # unary minus on unsigned (beware INT_MIN)
|
||||
'/wd4244', # lossy type conversion (e.g. double -> int)
|
||||
'/wd4305', # truncating type conversion (e.g. double -> float)
|
||||
cc.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
|
||||
language : 'c')
|
||||
|
||||
# Enable some warnings on MSVC to match GCC/Clang behaviour
|
||||
'/w14062', # enumerator 'identifier' in switch of enum 'enumeration' is not handled
|
||||
'/w14101', # 'identifier' : unreferenced local variable
|
||||
'/w14189', # 'identifier' : local variable is initialized but not referenced
|
||||
]
|
||||
add_project_arguments(msvc_args, language: 'c')
|
||||
elif cc.has_link_argument('-Wl,-Bsymbolic-functions')
|
||||
# FIXME: Add an option for this if people ask for it
|
||||
add_project_link_arguments('-Wl,-Bsymbolic-functions', language : 'c')
|
||||
|
|
Loading…
Reference in a new issue