@@ -32,13 +32,17 @@ if (NOT ("$ENV{VALGRIND}" STREQUAL "YES"))
3232endif ()
3333
3434# Set BUILD_TARGET, currently values supported:
35- # "X86_64", "AMD_64", "X86_32", "ARM_32", "MIPS_32", "XTENSA_32"
35+ # "X86_64", "AMD_64", "X86_32", "ARM_32", "MIPS_32", "XTENSA_32", "GENERAL"
36+ #set (BUILD_TARGET "X86_64")
37+
3638if (NOT BUILD_TARGET)
3739 if (CMAKE_SIZEOF_VOID_P EQUAL 8)
3840 # Build as X86_64 by default in 64-bit platform
41+ # if BUILD_TARGET isn't set
3942 set (BUILD_TARGET "X86_64" )
4043 else ()
4144 # Build as X86_32 by default in 32-bit platform
45+ # if BUILD_TARGET isn't set
4246 set (BUILD_TARGET "X86_32" )
4347 endif ()
4448endif ()
@@ -58,6 +62,14 @@ elseif (BUILD_TARGET STREQUAL "MIPS_32")
5862 add_definitions (-DBUILD_TARGET_MIPS_32)
5963elseif (BUILD_TARGET STREQUAL "XTENSA_32" )
6064 add_definitions (-DBUILD_TARGET_XTENSA_32)
65+ elseif (BUILD_TARGET STREQUAL "GENERAL" )
66+ # Will use invokeNative_general.c instead of assembly code,
67+ # but the maximum number of native arguments is limited to 20,
68+ # and there are possible issues when passing arguments to
69+ # native function for some cpus, e.g. int64 and double arguments
70+ # in arm and mips need to be 8-bytes aligned, and some arguments
71+ # of x86_64 are passed by registers but not stack
72+ add_definitions (-DBUILD_TARGET_GENERAL)
6173else ()
6274 message (FATAL_ERROR "-- Build target isn't set" )
6375endif ()
@@ -91,6 +103,8 @@ include_directories (.
91103 ../../runtime/platform/include
92104 ${SHARED_LIB_DIR} /include )
93105
106+ enable_language (ASM)
107+
94108include (../../runtime/platform/${PLATFORM} /platform.cmake)
95109include (../../runtime/utils/utils.cmake)
96110include (../../runtime/vmcore-wasm/vmcore.cmake)
0 commit comments