This repository has been archived on 2023-11-05. You can view files and clone it, but cannot push or open issues or pull requests.
wasm-micro-runtime/wamr-sdk/app/wamr_toolchain.cmake
Wenyong Huang 724858c731
Update wasm app build scripts for wasi-sdk-12 and refine interpreter (#481)
Update wasm app build scripts for wasi-sdk-12.0: add --export=__main_argc_argv, remove --no-threads
Lookup function with name "__main_argc_argv" as main function besides "main"
Change module_malloc to runtime_malloc in wasi native lib
Refine classic interpreter op_block and op_br_table
Refine faster interpreter op_br_table

Signed-off-by: Wenyong Huang <wenyong.huang@intel.com>
2020-12-28 10:46:31 +08:00

30 lines
1.4 KiB
CMake

# Copyright (C) 2019 Intel Corporation. All rights reserved.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
SET(CMAKE_SYSTEM_NAME Linux)
SET(CMAKE_SYSTEM_PROCESSOR wasm32)
SET (CMAKE_SYSROOT ${CMAKE_CURRENT_LIST_DIR}/libc-builtin-sysroot)
if (NOT DEFINED WASI_SDK_DIR)
SET (WASI_SDK_DIR "/opt/wasi-sdk")
endif ()
SET (CMAKE_C_FLAGS "-nostdlib -z stack-size=4096" CACHE INTERNAL "")
SET (CMAKE_C_COMPILER_TARGET "wasm32")
SET (CMAKE_C_COMPILER "${WASI_SDK_DIR}/bin/clang")
SET (CMAKE_CXX_FLAGS "-nostdlib -z stack-size=4096" CACHE INTERNAL "")
SET (CMAKE_CXX_COMPILER_TARGET "wasm32")
SET (CMAKE_CXX_COMPILER "${WASI_SDK_DIR}/bin/clang++")
SET (CMAKE_EXE_LINKER_FLAGS
"-Wl,--initial-memory=65536,--no-entry,--strip-all" CACHE INTERNAL "")
SET (CMAKE_LINKER "${WASI_SDK_DIR}/bin/wasm-ld" CACHE INTERNAL "")
SET (CMAKE_AR "${WASI_SDK_DIR}/bin/llvm-ar" CACHE INTERNAL "")
SET (CMAKE_NM "${WASI_SDK_DIR}/bin/llvm-nm" CACHE INTERNAL "")
SET (CMAKE_OBJDUMP "${WASI_SDK_DIR}/bin/llvm-dwarfdump" CACHE INTERNAL "")
SET (CMAKE_RANLIB "${WASI_SDK_DIR}/bin/llvm-ranlib" CACHE INTERNAL "")
SET (CMAKE_EXE_LINKER_FLAGS
"${CMAKE_EXE_LINKER_FLAGS},--allow-undefined-file=${CMAKE_SYSROOT}/share/defined-symbols.txt" CACHE INTERNAL "")