[v16,30/60] app/test-pmd: check compiler supports flag when adding to set

Message ID 1736821958-3295-31-git-send-email-andremue@linux.microsoft.com (mailing list archive)
State Changes Requested
Delegated to: David Marchand
Headers
Series remove use of VLAs for Windows |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Andre Muezerie Jan. 14, 2025, 2:32 a.m. UTC
This is done so that multiple compilers can be supported.

Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
---
 app/test-pmd/meson.build | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
  

Patch

diff --git a/app/test-pmd/meson.build b/app/test-pmd/meson.build
index f1c36529b4..8de1528428 100644
--- a/app/test-pmd/meson.build
+++ b/app/test-pmd/meson.build
@@ -3,7 +3,15 @@ 
 
 # override default name to drop the hyphen
 name = 'testpmd'
-cflags += '-Wno-deprecated-declarations'
+
+extra_flags = ['-Wno-deprecated-declarations']
+
+foreach arg: extra_flags
+    if cc.has_argument(arg)
+        cflags += arg
+    endif
+endforeach
+
 sources = files(
         '5tswap.c',
         'cmdline.c',