Skip to content

Commit 0babc62

Browse files
committed
Refactor CMake configuration and add default manifest for board
1 parent f34bb6c commit 0babc62

File tree

4 files changed

+15
-3
lines changed

4 files changed

+15
-3
lines changed

boards/MICROLITE/CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,6 @@ endforeach()
2727
configure_file(${CMAKE_BINARY_DIR}/sdkconfig.combined.in ${CMAKE_BINARY_DIR}/sdkconfig.combined COPYONLY)
2828
set(SDKCONFIG_DEFAULTS ${CMAKE_BINARY_DIR}/sdkconfig.combined)
2929

30-
set(ENV{IDF_COMPONENT_MANAGER} "1")
31-
3230
# Include main IDF cmake file and define the project.
3331
set(ENV{IDF_COMPONENT_MANAGER} "1")
3432
include($ENV{IDF_PATH}/tools/cmake/project.cmake)

boards/MICROLITE/mpconfigboard.cmake

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@ message (STATUS "mpconfigboard.cmake: PROJECT_DIR=${PROJECT_DIR}")
1313
set(USER_C_MODULES
1414
${PROJECT_DIR}/src/full.cmake
1515
)
16+
17+
if(NOT MICROPY_FROZEN_MANIFEST)
18+
set(MICROPY_FROZEN_MANIFEST ${PROJECT_DIR}/src/manifest.py)
19+
endif()

src/base.cmake

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ if (CONFIG_IDF_TARGET)
4848
set(TF_ESP_DIR "${CMAKE_CURRENT_LIST_DIR}/../third_party/esp-tflite-micro")
4949
set(TF_LITE_DIR "${TF_ESP_DIR}/tensorflow/lite")
5050
set(TF_MICRO_DIR "${TF_LITE_DIR}/micro")
51+
set(COMPILER_MLIR_DIR "${TF_ESP_DIR}/tensorflow/compiler/mlir")
5152
set(TF_MICROLITE_LOG
5253
${TF_MICRO_DIR}/debug_log.cc
5354
${TF_MICRO_DIR}/micro_time.cc
@@ -136,6 +137,10 @@ file(GLOB TF_MICRO_TFLITE_BRIDGE_SRCS
136137
"${TF_MICRO_DIR}/tflite_bridge/*.cc"
137138
"${TF_MICRO_DIR}/tflite_bridge/*.c")
138139

140+
file(GLOB TF_MLIR_API_SRCS
141+
"${CMAKE_CURRENT_LIST_DIR}/tflm/tensorflow/compiler/mlir/lite/core/api/error_reporter.cc"
142+
)
143+
139144
set (BOARD_ADDITIONAL_SRCS "")
140145

141146
if (CONFIG_IDF_TARGET)
@@ -162,7 +167,6 @@ endif()
162167
# microlite micropython module sources
163168
set (MICROLITE_PYTHON_SRCS
164169
${CMAKE_CURRENT_LIST_DIR}/microlite/tensorflow-microlite.c
165-
${CMAKE_CURRENT_LIST_DIR}/microlite/micropython-error-reporter.cpp
166170
)
167171

168172
if (CONFIG_IDF_TARGET)
@@ -195,6 +199,9 @@ target_sources(microlite INTERFACE
195199
${TF_MICROLITE_LOG}
196200
${ESP_NN_SRCS} # include esp-nn sources for Espressif chipsets
197201
${ESP_NN_WRAPPERS} # add tflm wrappers for ESP_NN
202+
203+
${TF_MLIR_API_SRCS}
204+
198205
)
199206

200207
if (CONFIG_IDF_TARGET)
@@ -239,6 +246,7 @@ target_include_directories(microlite INTERFACE
239246
${CMAKE_CURRENT_LIST_DIR}/tflm/third_party/flatbuffers/include
240247
${CMAKE_CURRENT_LIST_DIR}/tflm/third_party/gemmlowp
241248
${CMAKE_CURRENT_LIST_DIR}/tflm/third_party/ruy
249+
${CMAKE_CURRENT_LIST_DIR}/tflm/tensorflow/compiler/mlir
242250
)
243251
endif()
244252

src/manifest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Include the board's default manifest.
2+
include("$(PORT_DIR)/boards/manifest.py")

0 commit comments

Comments
 (0)