From 65aea950071e6fc797ac65d215973d77c95da415 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=9D=B4=ED=95=9C=EC=A2=85/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Engineer/=EC=82=BC=EC=84=B1=EC=A0=84?= =?utf8?q?=EC=9E=90?= Date: Wed, 25 Jul 2018 16:00:45 +0900 Subject: [PATCH] [neurun] Build backends as static lib (#2074) To reduce packaging maintanance change backend build as static. Signed-off-by: Hanjoung Lee --- runtimes/neurun/src/backend/acl_cl/CMakeLists.txt | 3 ++- runtimes/neurun/src/backend/cpu/CMakeLists.txt | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/runtimes/neurun/src/backend/acl_cl/CMakeLists.txt b/runtimes/neurun/src/backend/acl_cl/CMakeLists.txt index 759ac4e..c233c0d 100644 --- a/runtimes/neurun/src/backend/acl_cl/CMakeLists.txt +++ b/runtimes/neurun/src/backend/acl_cl/CMakeLists.txt @@ -1,6 +1,6 @@ file(GLOB SOURCES "*.cc") -add_library(${LIB_NEURUN_BACKEND_ACL_CL} SHARED ${SOURCES}) +add_library(${LIB_NEURUN_BACKEND_ACL_CL} STATIC ${SOURCES}) target_include_directories(${LIB_NEURUN_BACKEND_ACL_CL} PUBLIC ${NNFW_INCLUDE_DIR}) target_include_directories(${LIB_NEURUN_BACKEND_ACL_CL} PUBLIC ${NEURUN_INCLUDE_DIR}) @@ -9,5 +9,6 @@ target_include_directories(${LIB_NEURUN_BACKEND_ACL_CL} PUBLIC ${CMAKE_SOURCE_DI target_link_libraries(${LIB_NEURUN_BACKEND_ACL_CL} arm_compute) target_link_libraries(${LIB_NEURUN_BACKEND_ACL_CL} nnfw_support_nnapi) +set_target_properties(${LIB_NEURUN_BACKEND_ACL_CL} PROPERTIES POSITION_INDEPENDENT_CODE ON) set_target_properties(${LIB_NEURUN_BACKEND_ACL_CL} PROPERTIES OUTPUT_NAME backend_acl_cl) install(TARGETS ${LIB_NEURUN_BACKEND_ACL_CL} DESTINATION lib/neurun) diff --git a/runtimes/neurun/src/backend/cpu/CMakeLists.txt b/runtimes/neurun/src/backend/cpu/CMakeLists.txt index 50ca365..ec223d3 100644 --- a/runtimes/neurun/src/backend/cpu/CMakeLists.txt +++ b/runtimes/neurun/src/backend/cpu/CMakeLists.txt @@ -1,6 +1,6 @@ file(GLOB SOURCES "*.cc") -add_library(${LIB_NEURUN_BACKEND_CPU} SHARED ${SOURCES}) +add_library(${LIB_NEURUN_BACKEND_CPU} STATIC ${SOURCES}) target_include_directories(${LIB_NEURUN_BACKEND_CPU} PUBLIC ${NNFW_INCLUDE_DIR}) target_include_directories(${LIB_NEURUN_BACKEND_CPU} PUBLIC ${NEURUN_INCLUDE_DIR}) @@ -11,5 +11,6 @@ target_link_libraries(${LIB_NEURUN_BACKEND_CPU} tensorflow-lite) target_link_libraries(${LIB_NEURUN_BACKEND_CPU} nnfw_util) target_link_libraries(${LIB_NEURUN_BACKEND_CPU} nnfw_support_nnapi) +set_target_properties(${LIB_NEURUN_BACKEND_CPU} PROPERTIES POSITION_INDEPENDENT_CODE ON) set_target_properties(${LIB_NEURUN_BACKEND_CPU} PROPERTIES OUTPUT_NAME backend_cpu) install(TARGETS ${LIB_NEURUN_BACKEND_CPU} DESTINATION lib/neurun) -- 2.7.4