feat(yml): Add ESP32-P4 and ESP32-C5 support (#4270)

- Add ESP32-P4 and ESP32-C5 support
- Support for compiler options of different floating-point types in various RISC-V chips
This commit is contained in:
ChenWen
2025-05-19 10:33:09 +08:00
committed by GitHub
parent 14d09bfb66
commit f4f33b6a76
4 changed files with 125 additions and 14 deletions

View File

@ -5,11 +5,15 @@
if (NOT CMAKE_BUILD_EARLY_EXPANSION)
if (CONFIG_IDF_TARGET_ARCH_RISCV)
set (WAMR_BUILD_TARGET "RISCV32")
if (CONFIG_IDF_TARGET_ESP32P4)
set (WAMR_BUILD_TARGET "RISCV32_ILP32F")
else ()
set (WAMR_BUILD_TARGET "RISCV32_ILP32")
endif ()
elseif (CONFIG_IDF_TARGET_ARCH_XTENSA)
set (WAMR_BUILD_TARGET "XTENSA")
set (WAMR_BUILD_TARGET "XTENSA")
else ()
message (FATAL_ERROR "Arch ${CONFIG_IDF_TARGET_ARCH} is not supported")
message (FATAL_ERROR "Arch ${CONFIG_IDF_TARGET_ARCH} is not supported")
endif ()
set (WAMR_BUILD_PLATFORM "esp-idf")
@ -41,31 +45,31 @@ if (NOT CMAKE_BUILD_EARLY_EXPANSION)
endif ()
if (CONFIG_WAMR_ENABLE_MULTI_MODULE)
set (WAMR_BUILD_MULTI_MODULE 1)
set (WAMR_BUILD_MULTI_MODULE 1)
endif ()
if (CONFIG_WAMR_ENABLE_SHARED_MEMORY)
set (WAMR_BUILD_SHARED_MEMORY 1)
set (WAMR_BUILD_SHARED_MEMORY 1)
endif ()
if (CONFIG_WAMR_ENABLE_MEMORY_PROFILING)
set (WAMR_BUILD_MEMORY_PROFILING 1)
set (WAMR_BUILD_MEMORY_PROFILING 1)
endif ()
if (CONFIG_WAMR_ENABLE_PERF_PROFILING)
set (WAMR_BUILD_PERF_PROFILING 1)
set (WAMR_BUILD_PERF_PROFILING 1)
endif ()
if (CONFIG_WAMR_ENABLE_REF_TYPES)
set (WAMR_BUILD_REF_TYPES 1)
set (WAMR_BUILD_REF_TYPES 1)
endif ()
if (CONFIG_WAMR_ENABLE_LIBC_WASI)
set (WAMR_BUILD_LIBC_WASI 1)
set (WAMR_BUILD_LIBC_WASI 1)
endif ()
if (CONFIG_WAMR_ENABLE_LIB_PTHREAD)
set (WAMR_BUILD_LIB_PTHREAD 1)
set (WAMR_BUILD_LIB_PTHREAD 1)
endif ()
set (WAMR_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../../..)
@ -89,7 +93,11 @@ idf_component_register(SRCS ${srcs}
target_compile_options(${COMPONENT_LIB} PRIVATE "-Wno-format")
if (CONFIG_IDF_TARGET_ARCH_RISCV)
target_compile_definitions(${COMPONENT_LIB} PUBLIC -DBUILD_TARGET_RISCV32_ILP32=1)
if (CONFIG_IDF_TARGET_ESP32P4)
target_compile_definitions(${COMPONENT_LIB} PUBLIC -DBUILD_TARGET_RISCV32_ILP32F=1)
else ()
target_compile_definitions(${COMPONENT_LIB} PUBLIC -DBUILD_TARGET_RISCV32_ILP32=1)
endif ()
elseif (CONFIG_IDF_TARGET_ARCH_XTENSA)
target_compile_definitions(${COMPONENT_LIB} PUBLIC -DBUILD_TARGET_XTENSA=1)
endif ()