From: 오형석/On-Device Lab(SR)/Staff Engineer/삼성전자 Date: Wed, 9 Jan 2019 04:15:33 +0000 (+0900) Subject: Use -fPIC build flag for tflite only (#4175) X-Git-Tag: submit/tizen/20190325.013700~396 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3dfbe57895854bdd259f5c641d9c39664b9d641a;p=platform%2Fcore%2Fml%2Fnnfw.git Use -fPIC build flag for tflite only (#4175) * Use -fPIC build flag for tflite only Instead of global setting, use -fPIC build flag for tenroflow lite only Signed-off-by: Hyeongseok Oh * Specify to build tensorflow lite library static --- diff --git a/cmake/option/option_armv7l-linux.cmake b/cmake/option/option_armv7l-linux.cmake index b295b4a..42988bc 100644 --- a/cmake/option/option_armv7l-linux.cmake +++ b/cmake/option/option_armv7l-linux.cmake @@ -18,7 +18,6 @@ set(FLAGS_COMMON ${FLAGS_COMMON} "-mfpu=neon-vfpv4" "-funsafe-math-optimizations" "-ftree-vectorize" - "-fPIC" ) # remove warning from arm cl diff --git a/externals/CMakeLists.txt b/externals/CMakeLists.txt index fcbdae9..2644984 100644 --- a/externals/CMakeLists.txt +++ b/externals/CMakeLists.txt @@ -86,9 +86,10 @@ if("${TARGET_OS}" STREQUAL "android") list(APPEND TFLITE_INCLUDES "${NDK_DIR}") endif() -add_library(tensorflow-lite ${TFLITE_SRCS}) +add_library(tensorflow-lite STATIC ${TFLITE_SRCS}) target_include_directories(tensorflow-lite SYSTEM PUBLIC ${TFLITE_INCLUDES}) target_compile_definitions(tensorflow-lite PUBLIC "GEMMLOWP_ALLOW_SLOW_SCALAR_FALLBACK") +target_compile_options(tensorflow-lite PRIVATE -fPIC) if(BUILD_TFLITE_BENCHMARK_MODEL) target_compile_definitions(tensorflow-lite PUBLIC "TFLITE_PROFILING_ENABLED") endif()