tools: Raise error if wasm module build failed

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
This commit is contained in:
Huang Qi 2023-07-31 17:22:08 +08:00 committed by Xiang Xiao
parent 32aefa44c5
commit 74db485277

View File

@ -81,8 +81,11 @@ define LINK_WASM
$(eval INITIAL_MEMORY=$(shell echo $(notdir $(bin)) | cut -d'#' -f2)) \ $(eval INITIAL_MEMORY=$(shell echo $(notdir $(bin)) | cut -d'#' -f2)) \
$(eval STACKSIZE=$(shell echo $(notdir $(bin)) | cut -d'#' -f3)) \ $(eval STACKSIZE=$(shell echo $(notdir $(bin)) | cut -d'#' -f3)) \
$(eval PROGNAME=$(shell echo $(notdir $(bin)) | cut -d'#' -f1)) \ $(eval PROGNAME=$(shell echo $(notdir $(bin)) | cut -d'#' -f1)) \
$(shell $(WCC) $(bin) $(WBIN) $(WCFLAGS) $(WLDFLAGS) $(COMPILER_RT_LIB) \ $(eval RETVAL=$(shell $(WCC) $(bin) $(WBIN) $(WCFLAGS) $(WLDFLAGS) $(COMPILER_RT_LIB) \
-o $(APPDIR)$(DELIM)wasm$(DELIM)$(PROGNAME).wasm) \ -o $(APPDIR)$(DELIM)wasm$(DELIM)$(PROGNAME).wasm || echo 1;)) \
$(if $(RETVAL), \
$(error wasm build failed for $(PROGNAME).wasm) \
) \
$(call WAMR_AOT_COMPILE) \ $(call WAMR_AOT_COMPILE) \
) \ ) \
) )