[neurun] Build backends as static lib (#2074)
author이한종/동작제어Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Wed, 25 Jul 2018 07:00:45 +0000 (16:00 +0900)
committer이춘석/동작제어Lab(SR)/Staff Engineer/삼성전자 <chunseok.lee@samsung.com>
Wed, 25 Jul 2018 07:00:45 +0000 (16:00 +0900)
To reduce packaging maintanance change backend build as static.

Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
runtimes/neurun/src/backend/acl_cl/CMakeLists.txt
runtimes/neurun/src/backend/cpu/CMakeLists.txt

index 759ac4e..c233c0d 100644 (file)
@@ -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)
index 50ca365..ec223d3 100644 (file)
@@ -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)