From: 오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 Date: Fri, 9 Aug 2019 01:16:05 +0000 (+0900) Subject: Revise cpu backend cmake (#6401) X-Git-Tag: submit/tizen/20190809.050447~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3969d8a7c63a0ac4555fce39a927cc9a63173ecd;p=platform%2Fcore%2Fml%2Fnnfw.git Revise cpu backend cmake (#6401) - cpu backend, hi-perf-cpu backend - Set strict build option: nnfw_common Signed-off-by: Hyeongseok Oh --- diff --git a/runtimes/neurun/backend/cpu/CMakeLists.txt b/runtimes/neurun/backend/cpu/CMakeLists.txt index 029fd03..bd5de07 100644 --- a/runtimes/neurun/backend/cpu/CMakeLists.txt +++ b/runtimes/neurun/backend/cpu/CMakeLists.txt @@ -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) diff --git a/runtimes/neurun/backend/hi_perf_cpu/CMakeLists.txt b/runtimes/neurun/backend/hi_perf_cpu/CMakeLists.txt index af27d85..b8bdfdc 100644 --- a/runtimes/neurun/backend/hi_perf_cpu/CMakeLists.txt +++ b/runtimes/neurun/backend/hi_perf_cpu/CMakeLists.txt @@ -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)