summaryrefslogtreecommitdiff
path: root/meson.build
diff options
context:
space:
mode:
authorNirbheek Chauhan <nirbheek@centricular.com>2020-11-04 18:43:41 +0530
committerNirbheek Chauhan <nirbheek@centricular.com>2020-11-05 01:42:48 +0530
commit9344403cfb109b5b61ac368cb00963b85342988e (patch)
treecae5a875cfc3344ff34c98e900aeec73f7c6318f /meson.build
parent2950c76c8f2c22130604ca37bb987ead6c1e25aa (diff)
downloadgstreamer-plugins-bad-9344403cfb109b5b61ac368cb00963b85342988e.tar.gz
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>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build16
1 files changed, 10 insertions, 6 deletions
diff --git a/meson.build b/meson.build
index 9f61688f8..c69ae9c9d 100644
--- a/meson.build
+++ b/meson.build
@@ -46,19 +46,23 @@ endif
cdata = configuration_data()
if cc.get_id() == 'msvc'
- # 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
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
+
+ # 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 : 'cpp')
+ add_project_arguments(msvc_args, language: ['c', 'cpp'])
# Disable SAFESEH with MSVC for plugins and libs that use external deps that
# are built with MinGW
noseh_link_args = ['/SAFESEH:NO']