summaryrefslogtreecommitdiffstats
path: root/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/build-scripts/esp-idf
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 12:08:03 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-05 12:08:18 +0000
commit5da14042f70711ea5cf66e034699730335462f66 (patch)
tree0f6354ccac934ed87a2d555f45be4c831cf92f4a /src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/build-scripts/esp-idf
parentReleasing debian version 1.44.3-2. (diff)
downloadnetdata-5da14042f70711ea5cf66e034699730335462f66.tar.xz
netdata-5da14042f70711ea5cf66e034699730335462f66.zip
Merging upstream version 1.45.3+dfsg.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/build-scripts/esp-idf')
-rw-r--r--src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/build-scripts/esp-idf/README.md31
-rw-r--r--src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/build-scripts/esp-idf/wamr/CMakeLists.txt57
2 files changed, 88 insertions, 0 deletions
diff --git a/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/build-scripts/esp-idf/README.md b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/build-scripts/esp-idf/README.md
new file mode 100644
index 000000000..6bec45d1e
--- /dev/null
+++ b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/build-scripts/esp-idf/README.md
@@ -0,0 +1,31 @@
+# wasm-micro-runtime as ESP-IDF component
+
+You can build an ESP-IDF project with wasm-micro-runtime as a component:
+
+- Make sure you have the ESP-IDF properly installed and setup
+- In particular have the following paths set:
+ - `WAMR_PATH` to point to your wasm-micro-runtime repository
+ - `IDF_PATH` to point to your ESP-IDF
+ - `source $IDF_PATH/export.sh`
+- Create a new project, e.g.: `idf.py create-project wamr-hello`
+- In the newly created project folder edit the `CMakeList.txt`:
+
+ ```
+ cmake_minimum_required(VERSION 3.5)
+
+ include($ENV{IDF_PATH}/tools/cmake/project.cmake)
+
+ set (COMPONENTS ${IDF_TARGET} main freertos esptool_py wamr)
+
+ list(APPEND EXTRA_COMPONENT_DIRS "$ENV{WAMR_PATH}/build-scripts/esp-idf")
+
+ project(wamr-hello)
+ ```
+- Develop your project in it's `main` component folder.
+
+You can find an example [here](../../product-mini/platforms/esp-idf).
+
+- Set target platform: `idf.py set-target esp32c3`
+- Build: `idf.py build`
+- Flash: `idf.py flash`
+- Check the output: `idf.py monitor` \ No newline at end of file
diff --git a/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/build-scripts/esp-idf/wamr/CMakeLists.txt b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/build-scripts/esp-idf/wamr/CMakeLists.txt
new file mode 100644
index 000000000..5ac04ddc9
--- /dev/null
+++ b/src/fluent-bit/lib/wasm-micro-runtime-WAMR-1.2.2/build-scripts/esp-idf/wamr/CMakeLists.txt
@@ -0,0 +1,57 @@
+# Copyright (C) 2021 Intel Corporation and others. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+
+# Set WAMR's build options
+if("${IDF_TARGET}" STREQUAL "esp32c3")
+ set(WAMR_BUILD_TARGET "RISCV32")
+else()
+ set(WAMR_BUILD_TARGET "XTENSA")
+endif()
+
+set(WAMR_BUILD_PLATFORM "esp-idf")
+
+if (NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE Release)
+endif ()
+
+if (NOT DEFINED WAMR_BUILD_INTERP)
+ set (WAMR_BUILD_INTERP 1)
+endif ()
+
+if (NOT DEFINED WAMR_BUILD_FAST_INTERP)
+ set (WAMR_BUILD_FAST_INTERP 1)
+endif ()
+
+if (NOT DEFINED WAMR_BUILD_AOT)
+ set (WAMR_BUILD_AOT 1)
+endif ()
+
+if (NOT DEFINED WAMR_BUILD_LIBC_BUILTIN)
+ set (WAMR_BUILD_LIBC_BUILTIN 1)
+endif ()
+
+if (NOT DEFINED WAMR_BUILD_APP_FRAMEWORK)
+ set (WAMR_BUILD_APP_FRAMEWORK 0)
+endif ()
+
+if (NOT CMAKE_BUILD_EARLY_EXPANSION)
+ if (WAMR_BUILD_TARGET STREQUAL "XTENSA")
+ idf_build_set_property(COMPILE_DEFINITIONS "-DBUILD_TARGET_XTENSA=1" APPEND)
+ endif ()
+ if (WAMR_BUILD_INTERP)
+ idf_build_set_property(COMPILE_DEFINITIONS "-DWASM_ENABLE_INTERP=1" APPEND)
+ endif ()
+ if (WAMR_BUILD_AOT)
+ idf_build_set_property(COMPILE_DEFINITIONS "-DWASM_ENABLE_AOT=1" APPEND)
+ endif ()
+
+ set(WAMR_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../../..)
+ include(${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake)
+endif()
+
+idf_component_register(SRCS ${WAMR_RUNTIME_LIB_SOURCE} ${PLATFORM_SHARED_SOURCE}
+ INCLUDE_DIRS ${IWASM_DIR}/include ${UTILS_SHARED_DIR} ${PLATFORM_SHARED_DIR} ${PLATFORM_SHARED_DIR}/../include
+ REQUIRES pthread lwip esp_timer
+)
+
+