mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-23 16:50:47 +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/gst-plugins-bad/-/merge_requests/1760>
This commit is contained in:
parent
2950c76c8f
commit
9344403cfb
1 changed files with 10 additions and 6 deletions
10
meson.build
10
meson.build
|
@ -46,19 +46,23 @@ endif
|
||||||
cdata = configuration_data()
|
cdata = configuration_data()
|
||||||
|
|
||||||
if cc.get_id() == 'msvc'
|
if cc.get_id() == 'msvc'
|
||||||
|
msvc_args = [
|
||||||
# Ignore several spurious warnings for things gstreamer does very commonly
|
# 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 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
|
# 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
|
# NOTE: Only add warnings here if you are sure they're spurious
|
||||||
msvc_args = [
|
|
||||||
'/wd4018', # implicit signed/unsigned conversion
|
'/wd4018', # implicit signed/unsigned conversion
|
||||||
'/wd4146', # unary minus on unsigned (beware INT_MIN)
|
'/wd4146', # unary minus on unsigned (beware INT_MIN)
|
||||||
'/wd4244', # lossy type conversion (e.g. double -> int)
|
'/wd4244', # lossy type conversion (e.g. double -> int)
|
||||||
'/wd4305', # truncating type conversion (e.g. double -> float)
|
'/wd4305', # truncating type conversion (e.g. double -> float)
|
||||||
cc.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
|
cc.get_supported_arguments(['/utf-8']), # set the input encoding to utf-8
|
||||||
|
|
||||||
|
# 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')
|
add_project_arguments(msvc_args, language: ['c', 'cpp'])
|
||||||
add_project_arguments(msvc_args, language : 'cpp')
|
|
||||||
# Disable SAFESEH with MSVC for plugins and libs that use external deps that
|
# Disable SAFESEH with MSVC for plugins and libs that use external deps that
|
||||||
# are built with MinGW
|
# are built with MinGW
|
||||||
noseh_link_args = ['/SAFESEH:NO']
|
noseh_link_args = ['/SAFESEH:NO']
|
||||||
|
|
Loading…
Reference in a new issue