summaryrefslogtreecommitdiff
path: root/runtimes/neurun/backend/cpu/CMakeLists.txt
blob: c7b9b4d6b77b96cca48f078bf80f8fb9331aa3d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
set(LIB_NEURUN_BACKEND_CPU neurun_backend_cpu)

file(GLOB_RECURSE SOURCES "*.cc")
file(GLOB_RECURSE TESTS "*.test.cc")
list(REMOVE_ITEM SOURCES ${TESTS})

add_library(${LIB_NEURUN_BACKEND_CPU} SHARED ${SOURCES})

target_link_libraries(${LIB_NEURUN_BACKEND_CPU} PUBLIC nnfw_lib_cpp14)
target_link_libraries(${LIB_NEURUN_BACKEND_CPU} PRIVATE nnfw_lib_misc nnfw_lib_cker)
target_link_libraries(${LIB_NEURUN_BACKEND_CPU} PRIVATE neurun_core)
target_link_libraries(${LIB_NEURUN_BACKEND_CPU} PRIVATE nnfw_common)
target_link_libraries(${LIB_NEURUN_BACKEND_CPU} PRIVATE nnfw_coverage)

set_target_properties(${LIB_NEURUN_BACKEND_CPU} PROPERTIES OUTPUT_NAME backend_cpu)

install(TARGETS ${LIB_NEURUN_BACKEND_CPU} DESTINATION lib)

# Unit Tests
set(TEST_NEURUN_BACKEND_CPU test_neurun_backend_cpu)

add_executable(${TEST_NEURUN_BACKEND_CPU} ${TESTS})

target_link_libraries(${TEST_NEURUN_BACKEND_CPU} ${LIB_NEURUN_BACKEND_CPU})
target_link_libraries(${TEST_NEURUN_BACKEND_CPU} gtest gtest_main ${LIB_PTHREAD})
target_include_directories(${TEST_NEURUN_BACKEND_CPU} PRIVATE ${NEURUN_INCLUDE_DIR})

add_test(${TEST_NEURUN_BACKEND_CPU} ${TEST_NEURUN_BACKEND_CPU})
install(TARGETS ${TEST_NEURUN_BACKEND_CPU} DESTINATION unittest)