Replace strict build flag setting in neurun frontend & core (#6279)
author오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Wed, 7 Aug 2019 00:40:54 +0000 (09:40 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Wed, 7 Aug 2019 00:40:54 +0000 (09:40 +0900)
- Replace neurun frontends and core strict build setting cmake from using compile option to linking nnfw_common interface
- Add strict build setting for nnfw api frontend and fix unused parameter warning

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
runtimes/neurun/core/CMakeLists.txt
runtimes/neurun/frontend/api/CMakeLists.txt
runtimes/neurun/frontend/api/wrapper/nnfw_api.cc
runtimes/neurun/frontend/nnapi/CMakeLists.txt
runtimes/neurun/frontend/tflite/CMakeLists.txt

index d5c389a..98d33ee 100644 (file)
@@ -4,5 +4,6 @@ add_library(neurun-core STATIC ${SOURCES})
 set_target_properties(neurun-core PROPERTIES POSITION_INDEPENDENT_CODE ON)
 target_include_directories(neurun-core PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
 target_include_directories(neurun-core PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
-target_link_libraries(neurun-core nnfw_lib_misc nnfw_lib_cpp14 nnfw_lib_cker dl)
-target_compile_options(neurun-core PRIVATE -Wall -Wextra -Werror)
+target_link_libraries(neurun-core PUBLIC nnfw_lib_misc nnfw_lib_cpp14)
+target_link_libraries(neurun-core PRIVATE nnfw_lib_cker dl)
+target_link_libraries(neurun-core PRIVATE dl nnfw_common)
index 2c1579d..e6103af 100644 (file)
@@ -3,7 +3,8 @@ file(GLOB_RECURSE API_SRC "*.cc")
 set(NEURUN_DEV nnfw-dev)
 add_library(${NEURUN_DEV} SHARED ${API_SRC})
 
-target_link_libraries(${NEURUN_DEV} nnfw-header)
-target_link_libraries(${NEURUN_DEV} ${LIB_NEURUN})
-target_link_libraries(${NEURUN_DEV} jsoncpp tflite_loader pthread)
+target_link_libraries(${NEURUN_DEV} PUBLIC nnfw-header)
+target_link_libraries(${NEURUN_DEV} PUBLIC neurun-core) # TODO Link PRIVATE neurun-core
+target_link_libraries(${NEURUN_DEV} PRIVATE jsoncpp tflite_loader pthread)
+target_link_libraries(${NEURUN_DEV} PRIVATE nnfw_common)
 install(TARGETS ${NEURUN_DEV} DESTINATION lib)
index 7856b9c..02fc028 100644 (file)
@@ -100,7 +100,8 @@ NNFW_STATUS nnfw_session::run()
   return NNFW_STATUS_NO_ERROR;
 }
 
-NNFW_STATUS nnfw_session::set_input(int index, NNFW_TYPE type, const void *buffer, size_t length)
+NNFW_STATUS nnfw_session::set_input(int index, NNFW_TYPE /*type*/, const void *buffer,
+                                    size_t length)
 {
   try
   {
@@ -114,7 +115,7 @@ NNFW_STATUS nnfw_session::set_input(int index, NNFW_TYPE type, const void *buffe
   return NNFW_STATUS_NO_ERROR;
 }
 
-NNFW_STATUS nnfw_session::set_output(int index, NNFW_TYPE type, void *buffer, size_t length)
+NNFW_STATUS nnfw_session::set_output(int index, NNFW_TYPE /*type*/, void *buffer, size_t length)
 {
   try
   {
index fa8aaa3..0115a48 100644 (file)
@@ -1,10 +1,9 @@
 file(GLOB_RECURSE SOURCES_FRONTEND "*.cc")
 
 add_library(${LIB_NEURUN} SHARED ${SOURCES_FRONTEND})
-target_link_libraries(${LIB_NEURUN} nnfw-header)
-target_link_libraries(${LIB_NEURUN} neurun-core)
-
-target_compile_options(${LIB_NEURUN} PRIVATE -Wall -Wextra -Werror)
+target_link_libraries(${LIB_NEURUN} PUBLIC nnfw-header)
+target_link_libraries(${LIB_NEURUN} PUBLIC neurun-core) # TODO Link PRIVATE neurun-core
+target_link_libraries(${LIB_NEURUN} PRIVATE nnfw_common)
 
 set_target_properties(${LIB_NEURUN} PROPERTIES OUTPUT_NAME neuralnetworks)
 
index ef2cd76..b913161 100644 (file)
@@ -9,9 +9,8 @@ add_library(tflite_loader SHARED ${SOURCES_TFLITE_LOADER})
 nnfw_find_package(FlatBuffersSource REQUIRED)
 target_include_directories(tflite_loader PUBLIC ${FlatBuffersSource_DIR}/include .)
 
-target_link_libraries(tflite_loader PRIVATE neurun-core)
-target_link_libraries(tflite_loader PRIVATE nnfw_lib_misc nnfw_lib_cpp14)
-
-target_compile_options(tflite_loader PRIVATE -Wall -Wextra -Werror)
+target_link_libraries(tflite_loader PUBLIC neurun-core) # TODO Link PRIVATE neurun-core
+target_link_libraries(tflite_loader PUBLIC nnfw_lib_misc nnfw_lib_cpp14)
+target_link_libraries(tflite_loader PRIVATE nnfw_common)
 
 install(TARGETS tflite_loader DESTINATION lib)