1 # Luci library is not supported is on cross build
2 if(CMAKE_CROSSCOMPILING)
6 nnfw_find_package(Luci QUIET)
8 message(STATUS "Luci not found. Skip onert_odc")
12 file(GLOB_RECURSE SOURCES "*.cc")
13 file(GLOB_RECURSE TESTS "*.test.cc")
14 list(REMOVE_ITEM SOURCES ${TESTS})
16 add_library(onert_odc SHARED ${SOURCES})
17 target_link_libraries(onert_odc PRIVATE onert_core luci::import luci::export luci::pass luci::loco)
18 target_link_libraries(onert_odc PRIVATE nnfw_common)
19 target_link_libraries(onert_odc PRIVATE nnfw_coverage)
21 install(TARGETS onert_odc LIBRARY DESTINATION lib/nnfw/odc)
25 endif(NOT ENABLE_TEST)
28 set(TEST_ONERT_ODC test_onert_odc)
30 add_executable(${TEST_ONERT_ODC} ${TESTS})
32 target_link_libraries(${TEST_ONERT_ODC} onert_odc)
33 # Requires linking nnfw_coverage: check header coverage
34 target_link_libraries(${TEST_ONERT_CORE} nnfw_coverage)
35 target_link_libraries(${TEST_ONERT_ODC} gtest gtest_main dl ${LIB_PTHREAD})
36 target_include_directories(${TEST_ONERT_ODC} PRIVATE $<TARGET_PROPERTY:onert_odc,INCLUDE_DIRECTORIES>)
38 add_test(${TEST_ONERT_ODC} ${TEST_ONERT_ODC})
39 install(TARGETS ${TEST_ONERT_ODC} DESTINATION unittest)