add WAMR to build
This commit is contained in:
+41
-5
@@ -6,10 +6,9 @@ if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
|
||||
|
||||
set(CMAKE_C_STANDARD 11)
|
||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
if(ESP_PLATFORM)
|
||||
# --------------------------------------------------------------------------
|
||||
# 1. ESP-IDF BUILD MODE (Target: ESP32-P4)
|
||||
@@ -48,10 +47,11 @@ else()
|
||||
projCOVERAGE_TEST=0
|
||||
)
|
||||
|
||||
include(FetchContent)
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# FreeRTOS Kernel via FetchContent
|
||||
# --------------------------------------------------------------------------
|
||||
include(FetchContent)
|
||||
|
||||
# Download FreeRTOS-Kernel Repository
|
||||
FetchContent_Declare(
|
||||
@@ -70,8 +70,36 @@ else()
|
||||
# Disable FreeRTOS Demos/Tests
|
||||
set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# WAMR (WebAssembly Micro Runtime) via FetchContent
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
FetchContent_Declare(
|
||||
wamr_runtime
|
||||
GIT_REPOSITORY https://github.com/bytecodealliance/wasm-micro-runtime.git
|
||||
GIT_TAG WAMR-2.4.5
|
||||
)
|
||||
|
||||
# WAMR Desktop-Konfiguration
|
||||
set(WAMR_BUILD_INTERP 1 CACHE BOOL "" FORCE)
|
||||
set(WAMR_BUILD_FAST_INTERP 1 CACHE BOOL "" FORCE)
|
||||
set(WAMR_BUILD_JIT 0 CACHE BOOL "" FORCE)
|
||||
set(WAMR_BUILD_AOT 0 CACHE BOOL "" FORCE)
|
||||
set(WAMR_BUILD_LIBC_BUILTIN 1 CACHE BOOL "" FORCE)
|
||||
|
||||
# Disable WASI
|
||||
set(WAMR_BUILD_LIBC_WASI 0 CACHE BOOL "" FORCE)
|
||||
|
||||
if(WIN32)
|
||||
set(WAMR_BUILD_PLATFORM "windows" CACHE STRING "" FORCE)
|
||||
elseif(APPLE)
|
||||
set(WAMR_BUILD_PLATFORM "darwin" CACHE STRING "" FORCE)
|
||||
else()
|
||||
set(WAMR_BUILD_PLATFORM "linux" CACHE STRING "" FORCE)
|
||||
endif()
|
||||
|
||||
# define Target 'freertos_kernel'
|
||||
FetchContent_MakeAvailable(FreeRTOS_Kernel)
|
||||
FetchContent_MakeAvailable(FreeRTOS_Kernel wamr_runtime)
|
||||
|
||||
# --------------------------------------------------------------------------
|
||||
# Nova64 Core Target
|
||||
@@ -85,10 +113,18 @@ else()
|
||||
)
|
||||
|
||||
# Link FreeRTOS Kernel to the nova64_core library
|
||||
target_link_libraries(nova64_core PRIVATE freertos_kernel freertos_config)
|
||||
target_link_libraries(nova64_core PRIVATE freertos_kernel freertos_config vmlib)
|
||||
|
||||
target_compile_definitions(nova64_core PRIVATE NOVA64_EXPORTS)
|
||||
|
||||
if(MSVC)
|
||||
add_compile_definitions(
|
||||
COMPILING_WASM_RUNTIME_API
|
||||
alignof=__alignof
|
||||
_Alignof=__alignof
|
||||
)
|
||||
endif()
|
||||
|
||||
if (WIN32)
|
||||
set_target_properties(nova64_core PROPERTIES
|
||||
C_VISIBILITY_PRESET hidden
|
||||
|
||||
Reference in New Issue
Block a user