summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorGavin Hu <gavin.hu@arm.com>2018-06-30 01:27:37 +0800
committerThomas Monjalon <thomas@monjalon.net>2018-07-11 21:14:21 +0200
commitd292a42fc86b6b3ab69abb36f3112720cceb0b4b (patch)
tree9481b6772f02464148db81ef88d4e4c5d2afb8e8 /examples
parentc0d022070f7c7a77c1a47fee55f971b2afb763d4 (diff)
downloaddpdk-d292a42fc86b6b3ab69abb36f3112720cceb0b4b.zip
dpdk-d292a42fc86b6b3ab69abb36f3112720cceb0b4b.tar.gz
dpdk-d292a42fc86b6b3ab69abb36f3112720cceb0b4b.tar.xz
build: fix for host clang and cross gcc
The following error hits if host cc compiler is clang(default one in most linux distributions) and the cross compiler is gcc. The root cause is: the hybride compilers add the warning options to the meson project as project arguments, which apply for both host compiling and cross compiling. But some options such as '-Wno-format-truncation' are not supported nor recognized by clang, so they have to be removed from the project arguments for the host compiler to run smoothily and added back as cflags for the cross compiler to compile for cross source files. The fix is remove unrecognized warning options from the meson project arguments shared by gcc and clang, as add them specifically for gcc or clang as cflags. [265/893] Compiling C object 'buildtools/pmdinfogen/pmdinfogen@exe/pmdinfogen.c.o'. warning: unknown warning option '-Wno-format-truncation' [-Wunknown-warning-option] Fixes: a55277a788 ("devtools: add test script for meson builds") Cc: stable@dpdk.org Signed-off-by: Gavin Hu <gavin.hu@arm.com> Reviewed-by: Phil Yang <phil.yang@arm.com> Reviewed-by: Song Zhu <song.zhu@arm.com> Reviewed-by: Steve Capper <steve.capper@arm.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/meson.build4
1 files changed, 4 insertions, 0 deletions
diff --git a/examples/meson.build b/examples/meson.build
index 3d15684..e655887 100644
--- a/examples/meson.build
+++ b/examples/meson.build
@@ -24,6 +24,10 @@ foreach example: examples
sources = []
allow_experimental_apis = false
cflags = machine_args
+ if cc.has_argument('-Wno-format-truncation')
+ cflags += '-Wno-format-truncation'
+ endif
+
ext_deps = [execinfo]
includes = [include_directories(example)]
deps = ['eal', 'mempool', 'net', 'mbuf', 'ethdev', 'cmdline']