From 60683ad7293d2a18a7939dc49bcea77d8e09b352 Mon Sep 17 00:00:00 2001 From: chunseoklee Date: Mon, 24 Jun 2024 23:17:22 +0900 Subject: [PATCH] Enable gen traininfo schema header in onert-micro (#13274) - traininfo generated header file ONE-DCO-1.0-Signed-off-by: Chunseok Lee --- onert-micro/CMakeLists.txt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/onert-micro/CMakeLists.txt b/onert-micro/CMakeLists.txt index d6491aedf8c..16364920b4f 100644 --- a/onert-micro/CMakeLists.txt +++ b/onert-micro/CMakeLists.txt @@ -11,6 +11,7 @@ if (NOT ARM_C_COMPILER_PATH) endif () set(OM_CIRCLE_SCHEMA onert_micro_circle_schema) +set(OM_TRAININFO_SCHEMA onert_micro_traininfo_schema) if (NOT_BUILD_EXTERNALS) message(STATUS "USE LOCAL EXTERNAL") @@ -49,6 +50,23 @@ else() SCHEMA_DIR "${CMAKE_CURRENT_BINARY_DIR}" SCHEMA_FILES "schema.fbs" ) + + set(SCHEMA_FILE "${NNAS_PROJECT_SOURCE_DIR}/runtime/libs/circle-schema/include/circle_traininfo.fbs") + + # NOTE Copy circle_schema.fbs as schema.fbs to generate "schema_generated.fbs" instead of "circle_schema_generated.fbs" + add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/traininfo.fbs" + COMMAND ${CMAKE_COMMAND} -E copy "${SCHEMA_FILE}" traininfo.fbs + WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}" + DEPENDS "${SCHEMA_FILE}" + ) + + FlatBuffers_Target(${OM_TRAININFO_SCHEMA} + OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/gen/circle-generated/circle" + INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/gen" + SCHEMA_DIR "${CMAKE_CURRENT_BINARY_DIR}" + SCHEMA_FILES "traininfo.fbs" + ) + set(Flatbuffers_DIR "${CMAKE_CURRENT_BINARY_DIR}/../../overlay/lib/cmake/flatbuffers") set(EXT_OVERLAY_DIR "${CMAKE_CURRENT_BINARY_DIR}/../../overlay") set(GENERATED_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/gen")