mirror of
https://github.com/bytecodealliance/wasm-micro-runtime.git
synced 2025-02-08 16:05:07 +00:00
![wenyongh](/assets/img/avatar_default.png)
* Implement memory profiler, optimize memory usage, modify code indent * Implement memory.grow and limit heap space base offset to 1G; modify iwasm build type to Release and 64 bit by default * Add a new extension library: connection * Fix bug of reading magic number and version in big endian platform * Re-org platform APIs: move most platform APIs from iwasm to shared-lib * Enhance wasm loader to fix some security issues * Fix issue about illegal load of EXC_RETURN into PC on stm32 board * Updates that let a restricted version of the interpreter run in SGX * Enable native/app address validation and conversion for wasm app * Remove wasm_application_exectue_* APIs from wasm_export.h which makes confused * Refine binary size and fix several minor issues Optimize interpreter LOAD/STORE opcodes to decrease the binary size Fix issues when using iwasm library: _bh_log undefined, bh_memory.h not found Remove unused _stdin/_stdout/_stderr global variables resolve in libc wrapper Add macros of global heap size, stack size, heap size for Zephyr main.c Clear compile warning of wasm_application.c * Add more strict security checks for libc wrapper API's * Use one libc wrapper copy for sgx and other platforms; remove bh_printf macro for other platform header files * Enhance security of libc strcpy/sprintf wrapper function * Fix issue of call native for x86_64/arm/mips, add module inst parameter for native wrapper functions * Remove get_module_inst() and fix issue of call native * Refine wgl lib: remove module_inst parameter from widget functions; move function index check to runtime instantiate * Refine interpreter call native process, refine memory boudary check * Fix issues of invokeNative function of arm/mips/general version * Add a switch to build simple sample without gui support
129 lines
5.2 KiB
CMake
129 lines
5.2 KiB
CMake
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
cmake_minimum_required(VERSION 3.8.2)
|
|
|
|
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
|
|
project(NONE)
|
|
|
|
enable_language (ASM)
|
|
|
|
zephyr_compile_definitions (-DNVALGRIND
|
|
-D__JLF__
|
|
-D__ZEPHYR__
|
|
-DWASM_ENABLE_BASE_LIB
|
|
-Dattr_container_malloc=bh_malloc
|
|
-Dattr_container_free=bh_free
|
|
-DWASM_ENABLE_GUI=1)
|
|
|
|
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)
|
|
|
|
target_include_directories(app PRIVATE ${IWASM_ROOT}/runtime/include
|
|
${IWASM_ROOT}/runtime/platform/zephyr
|
|
${IWASM_ROOT}/runtime/platform/include
|
|
${IWASM_ROOT}/runtime/utils
|
|
${IWASM_ROOT}/runtime/vmcore-wasm
|
|
${IWASM_ROOT}/lib/native/base
|
|
${IWASM_ROOT}/lib/native/libc
|
|
${IWASM_ROOT}/lib/native/extension/sensor
|
|
${IWASM_ROOT}/lib/native/extension/connection
|
|
${IWASM_ROOT}/lib/native/extension/gui
|
|
${IWASM_ROOT}/lib/native-interface
|
|
${IWASM_ROOT}/lib/3rdparty
|
|
${IWASM_ROOT}/lib/3rdparty/lvgl
|
|
${IWASM_ROOT}/lib/3rdparty/lvgl/src
|
|
${APP_MGR_ROOT}/app-manager
|
|
${APP_MGR_ROOT}/app-mgr-shared
|
|
${SHARED_LIB_ROOT}/include
|
|
${SHARED_LIB_ROOT}/platform/include
|
|
${SHARED_LIB_ROOT}/platform/zephyr
|
|
${SHARED_LIB_ROOT}/mem-alloc/ems
|
|
${SHARED_LIB_ROOT}/utils
|
|
${SHARED_LIB_ROOT}/coap/er-coap
|
|
${SHARED_LIB_ROOT}/coap/extension
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../src
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../src/platform/zephyr
|
|
)
|
|
|
|
file (GLOB_RECURSE GUI_SRC ${IWASM_ROOT}/lib/native/extension/gui/*.c ${IWASM_ROOT}/lib/3rdparty/lvgl/*.c)
|
|
|
|
set (IWASM_SRCS
|
|
${IWASM_ROOT}/runtime/platform/zephyr/wasm_native.c
|
|
${IWASM_ROOT}/runtime/utils/wasm_dlfcn.c
|
|
${IWASM_ROOT}/runtime/utils/wasm_hashmap.c
|
|
${IWASM_ROOT}/runtime/utils/wasm_log.c
|
|
${IWASM_ROOT}/runtime/utils/wasm_vector.c
|
|
${IWASM_ROOT}/runtime/vmcore-wasm/wasm_application.c
|
|
${IWASM_ROOT}/runtime/vmcore-wasm/wasm_interp.c
|
|
${IWASM_ROOT}/runtime/vmcore-wasm/wasm_loader.c
|
|
${IWASM_ROOT}/runtime/vmcore-wasm/wasm_runtime.c
|
|
${IWASM_ROOT}/runtime/vmcore-wasm/invokeNative_general.c
|
|
${IWASM_ROOT}/lib/native/base/base_lib_export.c
|
|
${IWASM_ROOT}/lib/native/base/request_response.c
|
|
${IWASM_ROOT}/lib/native/base/timer_wrapper.c
|
|
${IWASM_ROOT}/lib/native/libc/libc_wrapper.c
|
|
${IWASM_ROOT}/lib/native/extension/sensor/runtime_sensor.c
|
|
${IWASM_ROOT}/lib/native/extension/connection/connection_wrapper.c
|
|
${IWASM_ROOT}/lib/native/extension/connection/zephyr/connection_lib_impl.c
|
|
${GUI_SRC}
|
|
${IWASM_ROOT}/lib/native-interface/attr_container.c
|
|
${IWASM_ROOT}/lib/native-interface/restful_utils.c
|
|
${APP_MGR_ROOT}/app-manager/app_manager.c
|
|
${APP_MGR_ROOT}/app-manager/app_manager_host.c
|
|
${APP_MGR_ROOT}/app-manager/ble_msg.c
|
|
${APP_MGR_ROOT}/app-manager/event.c
|
|
${APP_MGR_ROOT}/app-manager/message.c
|
|
${APP_MGR_ROOT}/app-manager/module_jeff.c
|
|
${APP_MGR_ROOT}/app-manager/module_utils.c
|
|
${APP_MGR_ROOT}/app-manager/module_wasm_app.c
|
|
${APP_MGR_ROOT}/app-manager/module_wasm_lib.c
|
|
${APP_MGR_ROOT}/app-manager/resource_reg.c
|
|
${APP_MGR_ROOT}/app-manager/watchdog.c
|
|
${APP_MGR_ROOT}/app-manager/platform/zephyr/app_mgr_zephyr.c
|
|
${SHARED_LIB_ROOT}/platform/zephyr/bh_assert.c
|
|
${SHARED_LIB_ROOT}/platform/zephyr/bh_definition.c
|
|
${SHARED_LIB_ROOT}/platform/zephyr/bh_platform.c
|
|
${SHARED_LIB_ROOT}/platform/zephyr/bh_platform_log.c
|
|
${SHARED_LIB_ROOT}/platform/zephyr/bh_thread.c
|
|
${SHARED_LIB_ROOT}/platform/zephyr/bh_time.c
|
|
${SHARED_LIB_ROOT}/platform/zephyr/bh_math.c
|
|
${SHARED_LIB_ROOT}/mem-alloc/bh_memory.c
|
|
${SHARED_LIB_ROOT}/mem-alloc/mem_alloc.c
|
|
${SHARED_LIB_ROOT}/mem-alloc/ems/ems_alloc.c
|
|
${SHARED_LIB_ROOT}/mem-alloc/ems/ems_hmu.c
|
|
${SHARED_LIB_ROOT}/mem-alloc/ems/ems_kfc.c
|
|
${SHARED_LIB_ROOT}/mem-alloc/tlsf/tlsf.c
|
|
${SHARED_LIB_ROOT}/utils/bh_list.c
|
|
${SHARED_LIB_ROOT}/utils/bh_log.c
|
|
${SHARED_LIB_ROOT}/utils/bh_queue.c
|
|
${SHARED_LIB_ROOT}/utils/runtime_timer.c
|
|
${SHARED_LIB_ROOT}/coap/er-coap/er-coap.c
|
|
${SHARED_LIB_ROOT}/coap/extension/coap_conversion.c
|
|
${SHARED_LIB_ROOT}/coap/extension/coap_over_tcp.c
|
|
)
|
|
|
|
set (LVGL_DRV_SRCS
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../src/platform/zephyr/display_ili9340_adafruit_1480.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../src/platform/zephyr/display_ili9340.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../src/platform/zephyr/XPT2046.c
|
|
)
|
|
|
|
target_sources(app PRIVATE ${IWASM_SRCS}
|
|
${LVGL_DRV_SRCS}
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../src/platform/zephyr/main.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../src/platform/zephyr/iwasm_main.c
|
|
${CMAKE_CURRENT_SOURCE_DIR}/../src/ext_lib_export.c)
|