From 74db485277174a111bbb84ffd852280c9358cb62 Mon Sep 17 00:00:00 2001 From: Huang Qi Date: Mon, 31 Jul 2023 17:22:08 +0800 Subject: [PATCH] tools: Raise error if wasm module build failed Signed-off-by: Huang Qi --- tools/Wasm.mk | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tools/Wasm.mk b/tools/Wasm.mk index 6f146765e..77497c19d 100644 --- a/tools/Wasm.mk +++ b/tools/Wasm.mk @@ -81,8 +81,11 @@ define LINK_WASM $(eval INITIAL_MEMORY=$(shell echo $(notdir $(bin)) | cut -d'#' -f2)) \ $(eval STACKSIZE=$(shell echo $(notdir $(bin)) | cut -d'#' -f3)) \ $(eval PROGNAME=$(shell echo $(notdir $(bin)) | cut -d'#' -f1)) \ - $(shell $(WCC) $(bin) $(WBIN) $(WCFLAGS) $(WLDFLAGS) $(COMPILER_RT_LIB) \ - -o $(APPDIR)$(DELIM)wasm$(DELIM)$(PROGNAME).wasm) \ + $(eval RETVAL=$(shell $(WCC) $(bin) $(WBIN) $(WCFLAGS) $(WLDFLAGS) $(COMPILER_RT_LIB) \ + -o $(APPDIR)$(DELIM)wasm$(DELIM)$(PROGNAME).wasm || echo 1;)) \ + $(if $(RETVAL), \ + $(error wasm build failed for $(PROGNAME).wasm) \ + ) \ $(call WAMR_AOT_COMPILE) \ ) \ )