summaryrefslogtreecommitdiff
path: root/tests/nnfw_api/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tests/nnfw_api/CMakeLists.txt')
-rw-r--r--tests/nnfw_api/CMakeLists.txt25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/nnfw_api/CMakeLists.txt b/tests/nnfw_api/CMakeLists.txt
new file mode 100644
index 000000000..4972e41dc
--- /dev/null
+++ b/tests/nnfw_api/CMakeLists.txt
@@ -0,0 +1,25 @@
+if (NOT BUILD_RUNTIME_NNFW_API_TEST)
+ return()
+endif(NOT BUILD_RUNTIME_NNFW_API_TEST)
+
+if (NOT BUILD_ONERT)
+ message(STATUS "Skip build NNFW API test: no runtime build")
+ return()
+endif(NOT BUILD_ONERT)
+
+nnfw_find_package(GTest)
+
+set(RUNTIME_NNFW_API_TEST nnfw_api_gtest)
+file(GLOB_RECURSE RUNTIME_NNFW_API_TEST_SRC "src/*.cc" "src/*.cpp")
+
+add_executable(${RUNTIME_NNFW_API_TEST} ${RUNTIME_NNFW_API_TEST_SRC})
+
+set(RUNTIME_NNFW_API_TEST_INCLUDE ${CMAKE_CURRENT_SOURCE_DIR}/include
+ ${CMAKE_CURRENT_SOURCE_DIR}/src)
+target_include_directories(${RUNTIME_NNFW_API_TEST} PRIVATE ${RUNTIME_NNFW_API_TEST_INCLUDE})
+
+target_link_libraries(${RUNTIME_NNFW_API_TEST} nnfw-dev)
+target_link_libraries(${RUNTIME_NNFW_API_TEST} gtest gmock)
+target_link_libraries(${RUNTIME_NNFW_API_TEST} ${LIB_PTHREAD} dl)
+
+install(TARGETS ${RUNTIME_NNFW_API_TEST} DESTINATION unittest)