Commit 94162929 authored by Nirbheek Chauhan's avatar Nirbheek Chauhan 🐜 Committed by GStreamer Marge Bot

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 gst-build!223

Part-of: <!918>
parent 9e37fa55
...@@ -44,17 +44,23 @@ plugins = [] ...@@ -44,17 +44,23 @@ plugins = []
cc = meson.get_compiler('c') cc = meson.get_compiler('c')
if cc.get_id() == 'msvc' if cc.get_id() == 'msvc'
# Ignore several spurious warnings for things gstreamer does very commonly msvc_args = [
# If a warning is completely useless and spammy, use '/wdXXXX' to suppress it # Ignore several spurious warnings for things gstreamer does very commonly
# If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once # If a warning is completely useless and spammy, use '/wdXXXX' to suppress it
# NOTE: Only add warnings here if you are sure they're spurious # If a warning is harmless but hard to fix, use '/woXXXX' so it's shown once
add_project_arguments( # NOTE: Only add warnings here if you are sure they're spurious
'/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
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', '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']
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment