2019-08-01 08:57:54 +00:00
|
|
|
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
2019-11-11 23:45:21 +00:00
|
|
|
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
2019-08-01 08:57:54 +00:00
|
|
|
|
|
|
|
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
|
2019-09-25 08:42:56 +00:00
|
|
|
-Dattr_container_free=bh_free
|
|
|
|
-DWASM_ENABLE_GUI=1)
|
2019-08-01 08:57:54 +00:00
|
|
|
|
2019-12-24 03:09:54 +00:00
|
|
|
# Build as THUMB by default
|
|
|
|
# change to "ARM[sub]", "THUMB[sub]", "X86_32", "MIPS" or "XTENSA"
|
2019-11-20 13:16:36 +00:00
|
|
|
# if we want to support arm_32, x86, mips or xtensa
|
|
|
|
if (NOT DEFINED BUILD_TARGET)
|
2019-12-24 03:09:54 +00:00
|
|
|
set (BUILD_TARGET "THUMB")
|
2019-11-01 05:38:45 +00:00
|
|
|
endif ()
|
|
|
|
|
|
|
|
string(TOUPPER ${BUILD_TARGET} BUILD_TARGET)
|
|
|
|
|
|
|
|
if (BUILD_TARGET STREQUAL "X86_32")
|
|
|
|
add_definitions(-DBUILD_TARGET_X86_32)
|
2019-12-24 03:09:54 +00:00
|
|
|
elseif (BUILD_TARGET MATCHES "ARM.*")
|
|
|
|
add_definitions(-DBUILD_TARGET_ARM)
|
|
|
|
add_definitions(-DBUILD_TARGET="${BUILD_TARGET}")
|
|
|
|
elseif (BUILD_TARGET MATCHES "THUMB.*")
|
|
|
|
add_definitions(-DBUILD_TARGET_THUMB)
|
|
|
|
add_definitions(-DBUILD_TARGET="${BUILD_TARGET}")
|
|
|
|
elseif (BUILD_TARGET STREQUAL "MIPS")
|
|
|
|
add_definitions(-DBUILD_TARGET_MIPS)
|
|
|
|
elseif (BUILD_TARGET STREQUAL "XTENSA")
|
|
|
|
add_definitions(-DBUILD_TARGET_XTENSA)
|
2019-11-01 05:38:45 +00:00
|
|
|
else ()
|
|
|
|
message (FATAL_ERROR "-- Build target isn't set")
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
message ("-- Build as target ${BUILD_TARGET}")
|
|
|
|
|
2019-11-20 13:16:36 +00:00
|
|
|
set (WASM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/core/iwasm)
|
|
|
|
set (APP_MGR_DIR ${CMAKE_CURRENT_SOURCE_DIR}/core/app-mgr)
|
|
|
|
set (SHARED_DIR ${WASM_DIR}/../shared-lib)
|
2019-08-01 08:57:54 +00:00
|
|
|
|
2019-11-20 13:16:36 +00:00
|
|
|
set (TARGET_PLATFORM "zephyr")
|
2019-08-01 08:57:54 +00:00
|
|
|
|
2019-11-20 13:16:36 +00:00
|
|
|
include (${WASM_DIR}/runtime/utils/utils.cmake)
|
|
|
|
include (${WASM_DIR}/runtime/vmcore-wasm/vmcore.cmake)
|
|
|
|
include (${WASM_DIR}/lib/native/base/wasm_lib_base.cmake)
|
|
|
|
include (${WASM_DIR}/lib/native/libc/wasm_libc.cmake)
|
|
|
|
include (${WASM_DIR}/lib/native/extension/sensor/wasm_lib_sensor.cmake)
|
|
|
|
include (${WASM_DIR}/lib/native/extension/gui/wasm_lib_gui.cmake)
|
|
|
|
include (${WASM_DIR}/lib/native/extension/connection/wasm_lib_conn.cmake)
|
|
|
|
include (${WASM_DIR}/lib/native/extension/connection/${TARGET_PLATFORM}/connection_mgr.cmake)
|
|
|
|
include (${WASM_DIR}/lib/native-interface/native_interface.cmake)
|
|
|
|
include (${APP_MGR_DIR}/app-manager/app_mgr.cmake)
|
|
|
|
include (${APP_MGR_DIR}/app-mgr-shared/app_mgr_shared.cmake)
|
|
|
|
include (${SHARED_DIR}/platform/${TARGET_PLATFORM}/shared_platform.cmake)
|
|
|
|
include (${SHARED_DIR}/utils/shared_utils.cmake)
|
|
|
|
include (${SHARED_DIR}/mem-alloc/mem_alloc.cmake)
|
|
|
|
include (${SHARED_DIR}/coap/lib_coap.cmake)
|
2019-08-01 08:57:54 +00:00
|
|
|
|
2019-12-18 03:53:43 +00:00
|
|
|
include_directories(${WASM_DIR}/runtime/platform/include)
|
2019-11-20 13:16:36 +00:00
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../src)
|
|
|
|
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../src/platform/zephyr)
|
2019-08-01 08:57:54 +00:00
|
|
|
|
2019-11-20 13:16:36 +00:00
|
|
|
set (LVGL_DRV_SRCS
|
2019-08-01 08:57:54 +00:00
|
|
|
${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
|
|
|
|
)
|
|
|
|
|
2019-11-20 13:16:36 +00:00
|
|
|
set (IWASM_SRCS
|
|
|
|
${WASM_PLATFORM_LIB_SOURCE}
|
|
|
|
${WASM_UTILS_LIB_SOURCE}
|
|
|
|
${VMCORE_LIB_SOURCE}
|
|
|
|
${WASM_LIBC_SOURCE}
|
|
|
|
${APP_MGR_SOURCE}
|
|
|
|
${WASM_LIB_BASE_SOURCE}
|
|
|
|
${WASM_LIB_EXT_SOURCE}
|
|
|
|
${WASM_LIB_SENSOR_SOURCE}
|
|
|
|
${WASM_LIB_GUI_SOURCE}
|
|
|
|
${WASM_LIB_CONN_SOURCE}
|
|
|
|
${WASM_LIB_CONN_MGR_SOURCE}
|
|
|
|
${PLATFORM_SHARED_SOURCE}
|
|
|
|
${UTILS_SHARED_SOURCE}
|
|
|
|
${MEM_ALLOC_SHARED_SOURCE}
|
|
|
|
${NATIVE_INTERFACE_SOURCE}
|
|
|
|
)
|
|
|
|
|
|
|
|
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
|
|
|
|
)
|