nncc_find_package(FlatBuffers OPTIONAL)
+###################
+# SCHEMA #
+###################
+
# Compile flatbuffers schemas
# Produces FB_GEN_SOURCES and FB_GEN_INCLUDE_DIRS variables
set(GENERATED_OUTPUT_DIR "${CMAKE_CURRENT_BINARY_DIR}/generated")
${CMAKE_CURRENT_SOURCE_DIR}/schema
schema_v3.fbs)
+add_nncc_library(tflite_schema STATIC ${FB_GEN_SOURCES})
+target_link_libraries(tflite_schema PUBLIC flatbuffers)
+target_include_directories(tflite_schema PUBLIC ${FB_GEN_INCLUDE_DIRS})
+
###################
# TFLITE importer #
###################
${CMAKE_CURRENT_SOURCE_DIR}/src/tflite_v3_importer.cpp
${CMAKE_CURRENT_SOURCE_DIR}/src/tflite_plugin.cpp)
file(GLOB tflite_importer_headers include/*.h)
-list(APPEND tflite_importer_headers ${FB_GEN_SOURCES})
set(tflite_import tflite_import)
add_library(${tflite_import} SHARED ${tflite_importer_sources} ${tflite_importer_headers})
-target_include_directories(${tflite_import} PUBLIC ${FB_GEN_INCLUDE_DIRS})
target_include_directories(${tflite_import} PUBLIC include)
+target_link_libraries(${tflite_import} PUBLIC tflite_schema)
target_link_libraries(${tflite_import} PUBLIC flatbuffers)
target_link_libraries(${tflite_import} PUBLIC ${nn_import_common})
target_link_libraries(${tflite_import} PUBLIC nnc_support)
set(tflite_import_example tflite_import_example)
add_executable(${tflite_import_example} ${tflite_example_sources} ${OPTIONS_SRC})
+target_link_libraries(${tflite_import_example} PUBLIC tflite_schema)
target_link_libraries(${tflite_import_example} PRIVATE ${tflite_import})