mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-02-06 15:05:19 +00:00
![Shi Lei](/assets/img/avatar_default.png)
* Add printingAdd print time for wamrc, fix posix mmap bug time for wamrc, fixed a posix mmap bug. Change-Id: Ib6517b8a69cf022a1a6a74efa1f98155aec143bc * Add a basic sample to show how native runtime invokes wasm app in WAMR, and how wasm app invokes native functions. Change-Id: I700ae413ad5e9ea04540d5187952305e1ee92d73
42 lines
1.3 KiB
CMake
42 lines
1.3 KiB
CMake
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
cmake_minimum_required (VERSION 2.8)
|
|
|
|
project (basic)
|
|
|
|
################ runtime settings ################
|
|
set (WAMR_BUILD_PLATFORM "linux")
|
|
|
|
# Reset default linker flags
|
|
set (CMAKE_SHARED_LIBRARY_LINK_C_FLAGS "")
|
|
set (CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS "")
|
|
|
|
# WAMR features switch
|
|
set (WAMR_BUILD_TARGET "X86_64")
|
|
set(CMAKE_BUILD_TYPE Debug)
|
|
set (WAMR_BUILD_INTERP 1)
|
|
set (WAMR_BUILD_AOT 1)
|
|
set (WAMR_BUILD_JIT 0)
|
|
set (WAMR_BUILD_LIBC_BUILTIN 1)
|
|
set (WAMR_BUILD_LIBC_WASI 1)
|
|
set (WAMR_BUILD_FAST_INTERP 0)
|
|
|
|
# linker flags
|
|
set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections -pie -fPIE")
|
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat -Wformat-security")
|
|
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mindirect-branch-register")
|
|
|
|
# build out vmlib
|
|
set (WAMR_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../..)
|
|
include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake)
|
|
|
|
add_library(vmlib ${WAMR_RUNTIME_LIB_SOURCE})
|
|
|
|
################ application related ################
|
|
include_directories(${CMAKE_CURRENT_LIST_DIR}/src)
|
|
include (${SHARED_DIR}/utils/uncommon/shared_uncommon.cmake)
|
|
|
|
add_executable (basic src/main.c src/native_impl.c ${UNCOMMON_SHARED_SOURCE})
|
|
|
|
target_link_libraries (basic vmlib -lm -ldl -lpthread -lrt) |