Add BUILD_TARGET setting in makefile (#135)

This commit is contained in:
wenyongh
2019-11-01 00:38:45 -05:00
committed by GitHub
parent 2a8b1ef454
commit 28993946ad
19 changed files with 432 additions and 138 deletions

View File

@ -27,6 +27,28 @@ zephyr_compile_definitions (-DNVALGRIND
-Dattr_container_free=bh_free
-DWASM_ENABLE_GUI=1)
# Build as ARM_32 by default, change to "X86_32", "MIPS_32" or "XTENSA_32"
# if we want to support x86, mips or xtensa
if (NOT BUILD_TARGET)
set (BUILD_TARGET "ARM_32")
endif ()
string(TOUPPER ${BUILD_TARGET} BUILD_TARGET)
if (BUILD_TARGET STREQUAL "X86_32")
add_definitions(-DBUILD_TARGET_X86_32)
elseif (BUILD_TARGET STREQUAL "ARM_32")
add_definitions(-DBUILD_TARGET_ARM_32)
elseif (BUILD_TARGET STREQUAL "MIPS_32")
add_definitions(-DBUILD_TARGET_MIPS_32)
elseif (BUILD_TARGET STREQUAL "XTENSA_32")
add_definitions(-DBUILD_TARGET_XTENSA_32)
else ()
message (FATAL_ERROR "-- Build target isn't set")
endif ()
message ("-- Build as target ${BUILD_TARGET}")
set (IWASM_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/core/iwasm)
set (APP_MGR_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/core/app-mgr)
set (SHARED_LIB_ROOT ${IWASM_ROOT}/../shared-lib)