amd/addrlib: use cpp.has_argument() to filter compiler arguments
authorPierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Wed, 25 Nov 2020 14:44:53 +0000 (15:44 +0100)
committerMarge Bot <eric+marge@anholt.net>
Tue, 5 Jan 2021 11:29:11 +0000 (11:29 +0000)
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7846>

src/amd/addrlib/meson.build

index db20504..f396c86 100644 (file)
@@ -53,12 +53,14 @@ files_addrlib = files(
 )
 
 cpp_args_addrlib = []
-if cpp.get_id() != 'msvc'
-  cpp_args_addrlib += '-Wno-unused-variable'
-  cpp_args_addrlib += '-Wno-unused-local-typedefs'
-  cpp_args_addrlib += '-Wno-unused-but-set-variable'
-  cpp_args_addrlib += '-Wno-maybe-uninitialized'
-endif
+foreach w : ['-Wno-unused-variable', '-Wno-unused-local-typedefs',
+             '-Wno-unused-but-set-variable', '-Wno-maybe-uninitialized']
+  if cpp.has_argument(w)
+    cpp_args_addrlib += w
+  endif
+endforeach
+
+message(cpp_args_addrlib)
 
 libamdgpu_addrlib = static_library(
   'addrlib',