Revise cpu backend cmake (#6401)
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Fri, 9 Aug 2019 01:16:05 +0000 (10:16 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Fri, 9 Aug 2019 01:16:05 +0000 (10:16 +0900)
- cpu backend, hi-perf-cpu backend
- Set strict build option: nnfw_common

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
runtimes/neurun/backend/cpu/CMakeLists.txt
runtimes/neurun/backend/hi_perf_cpu/CMakeLists.txt

index 029fd03..bd5de07 100644 (file)
@@ -6,20 +6,23 @@ list(REMOVE_ITEM SOURCES ${TESTS})
 
 add_library(${LIB_NEURUN_BACKEND_CPU} SHARED ${SOURCES})
 
-target_link_libraries(${LIB_NEURUN_BACKEND_CPU} nnfw_lib_misc nnfw_lib_cpp14 nnfw_lib_cker)
-target_link_libraries(${LIB_NEURUN_BACKEND_CPU} neurun-core)
-
-target_compile_options(${LIB_NEURUN_BACKEND_CPU} PRIVATE -Wall -Wextra -Werror)
+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)
 
 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})
-add_test(${TEST_NEURUN_BACKEND_CPU} ${TEST_NEURUN_BACKEND_CPU})
+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)
index af27d85..b8bdfdc 100644 (file)
@@ -19,25 +19,25 @@ list(REMOVE_ITEM SOURCES ${TESTS})
 
 add_library(${LIB_NEURUN_BACKEND_HI_PERF_CPU} SHARED ${SOURCES})
 
-target_link_libraries(${LIB_NEURUN_BACKEND_HI_PERF_CPU} nnfw_lib_misc)
-target_link_libraries(${LIB_NEURUN_BACKEND_HI_PERF_CPU} nnfw_lib_cpp14)
-target_link_libraries(${LIB_NEURUN_BACKEND_HI_PERF_CPU} neurun-core)
-
-target_compile_options(${LIB_NEURUN_BACKEND_HI_PERF_CPU} PRIVATE -Wall -Wextra -Werror)
+target_link_libraries(${LIB_NEURUN_BACKEND_HI_PERF_CPU} PRIVATE nnfw_lib_misc)
+target_link_libraries(${LIB_NEURUN_BACKEND_HI_PERF_CPU} PRIVATE nnfw_lib_cpp14)
+target_link_libraries(${LIB_NEURUN_BACKEND_HI_PERF_CPU} PRIVATE neurun-core)
+target_link_libraries(${LIB_NEURUN_BACKEND_HI_PERF_CPU} PRIVATE nnfw_common)
+target_link_libraries(${LIB_NEURUN_BACKEND_HI_PERF_CPU} PRIVATE nnpack pthreadpool cpuinfo)
+target_include_directories(${LIB_NEURUN_BACKEND_HI_PERF_CPU} PRIVATE ${NNPACK_INCLUDE_DIRS})
 
 set_target_properties(${LIB_NEURUN_BACKEND_HI_PERF_CPU} PROPERTIES OUTPUT_NAME backend_NNPACK)
-install(TARGETS ${LIB_NEURUN_BACKEND_HI_PERF_CPU} DESTINATION lib)
 
-target_link_libraries(${LIB_NEURUN_BACKEND_HI_PERF_CPU} nnpack pthreadpool cpuinfo)
-target_include_directories(${LIB_NEURUN_BACKEND_HI_PERF_CPU} PRIVATE ${NNPACK_INCLUDE_DIRS})
+install(TARGETS ${LIB_NEURUN_BACKEND_HI_PERF_CPU} DESTINATION lib)
 
 # Unit Tests
 set(TEST_NEURUN_BACKEND_HI_PERF_CPU test_neurun_backend_hi_perf)
 
 add_executable(${TEST_NEURUN_BACKEND_HI_PERF_CPU} ${TESTS})
+
 target_link_libraries(${TEST_NEURUN_BACKEND_HI_PERF_CPU} ${LIB_NEURUN_BACKEND_HI_PERF_CPU})
 target_link_libraries(${TEST_NEURUN_BACKEND_HI_PERF_CPU} gtest gtest_main ${LIB_PTHREAD})
-add_test(${TEST_NEURUN_BACKEND_HI_PERF_CPU} ${TEST_NEURUN_BACKEND_HI_PERF_CPU})
-target_include_directories(${TEST_NEURUN_BACKEND_HI_PERF_CPU} PRIVATE ${NNPACK_INCLUDE_DIR})
+target_link_libraries(${TEST_NEURUN_BACKEND_HI_PERF_CPU} nnpack)
 
+add_test(${TEST_NEURUN_BACKEND_HI_PERF_CPU} ${TEST_NEURUN_BACKEND_HI_PERF_CPU})
 install(TARGETS ${TEST_NEURUN_BACKEND_HI_PERF_CPU} DESTINATION unittest)