diff options
author | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-11-04 18:48:13 +0530 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2020-11-04 18:48:13 +0530 |
commit | b7f155c3b3ab79ed2b14408107aff48baa811f2e (patch) | |
tree | f55de198c899e6a1f6056e8d23024c0aec6c4404 | |
parent | 0ee03f2b1d6e450bf2603b1783dc3b0cd8aec683 (diff) |
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-omx/-/merge_requests/75>
-rw-r--r-- | meson.build | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/meson.build b/meson.build index 7db071c565..5a26fd51d4 100644 --- a/meson.build +++ b/meson.build @@ -25,16 +25,23 @@ plugins_install_dir = '@0@/gstreamer-1.0'.format(get_option('libdir')) cc = meson.get_compiler('c') 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 - 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) - language : 'c') + 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') # Disable SAFESEH with MSVC for plugins and libs that use external deps that # are built with MinGW noseh_link_args = ['/SAFESEH:NO'] |