meson: Ignore msvc warnings in C++ as well
authorScott D Phillips <scott.d.phillips@intel.com>
Mon, 8 May 2017 18:01:39 +0000 (11:01 -0700)
committerTim-Philipp Müller <tim@centricular.com>
Mon, 8 May 2017 18:18:03 +0000 (19:18 +0100)
We were only ignoring the listed msvc warnings for C language
files and not C++. This was working by the coincidence that we did
not have any instances of these warnings in C++ files. Lately the
build of decklink has been fixed on windows, and it has an
instance of one of these warnings in a C++ file.

https://bugzilla.gnome.org/show_bug.cgi?id=782345

meson.build

index 259fa91..f1d8da7 100644 (file)
@@ -34,12 +34,14 @@ if cc.get_id() == 'msvc'
   # 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 = [
       '/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')
+  ]
+  add_project_arguments(msvc_args, language : 'c')
+  add_project_arguments(msvc_args, language : 'cpp')
   # Disable SAFESEH with MSVC for plugins and libs that use external deps that
   # are built with MinGW
   noseh_link_args = ['/SAFESEH:NO']