mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2026-04-18 18:18:44 +00:00
Add build target general
This commit is contained in:
parent
d83e7c43c6
commit
3245d4fec8
|
|
@ -32,13 +32,17 @@ if (NOT ("$ENV{VALGRIND}" STREQUAL "YES"))
|
|||
endif ()
|
||||
|
||||
# Set BUILD_TARGET, currently values supported:
|
||||
# "X86_64", "AMD_64", "X86_32", "ARM_32", "MIPS_32", "XTENSA_32"
|
||||
# "X86_64", "AMD_64", "X86_32", "ARM_32", "MIPS_32", "XTENSA_32", "GENERAL"
|
||||
#set (BUILD_TARGET "X86_64")
|
||||
|
||||
if (NOT BUILD_TARGET)
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
# Build as X86_64 by default in 64-bit platform
|
||||
# if BUILD_TARGET isn't set
|
||||
set (BUILD_TARGET "X86_64")
|
||||
else ()
|
||||
# Build as X86_32 by default in 32-bit platform
|
||||
# if BUILD_TARGET isn't set
|
||||
set (BUILD_TARGET "X86_32")
|
||||
endif ()
|
||||
endif ()
|
||||
|
|
@ -58,6 +62,14 @@ elseif (BUILD_TARGET STREQUAL "MIPS_32")
|
|||
add_definitions(-DBUILD_TARGET_MIPS_32)
|
||||
elseif (BUILD_TARGET STREQUAL "XTENSA_32")
|
||||
add_definitions(-DBUILD_TARGET_XTENSA_32)
|
||||
elseif (BUILD_TARGET STREQUAL "GENERAL")
|
||||
# Will use invokeNative_general.c instead of assembly code,
|
||||
# but the maximum number of native arguments is limited to 20,
|
||||
# and there are possible issues when passing arguments to
|
||||
# native function for some cpus, e.g. int64 and double arguments
|
||||
# in arm and mips need to be 8-bytes aligned, and some arguments
|
||||
# of x86_64 are passed by registers but not stack
|
||||
add_definitions(-DBUILD_TARGET_GENERAL)
|
||||
else ()
|
||||
message (FATAL_ERROR "-- Build target isn't set")
|
||||
endif ()
|
||||
|
|
|
|||
|
|
@ -30,6 +30,8 @@ elseif (${BUILD_TARGET} STREQUAL "MIPS_32")
|
|||
set (source_all ${c_source_all} ${VMCORE_LIB_DIR}/invokeNative_mips.s)
|
||||
elseif (${BUILD_TARGET} STREQUAL "XTENSA_32")
|
||||
set (source_all ${c_source_all} ${VMCORE_LIB_DIR}/invokeNative_xtensa.s)
|
||||
elseif (${BUILD_TARGET} STREQUAL "GENERAL")
|
||||
set (source_all ${c_source_all} ${VMCORE_LIB_DIR}/invokeNative_general.c)
|
||||
else ()
|
||||
message (FATAL_ERROR "Build target isn't set")
|
||||
endif ()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user