diff --git a/predict/CMakeLists.txt b/predict/CMakeLists.txt index 2641932769..39ca6b27e8 100755 --- a/predict/CMakeLists.txt +++ b/predict/CMakeLists.txt @@ -6,6 +6,7 @@ set(CMAKE_BUILD_TYPE "Release") set(CMAKE_CXX_STANDARD 11) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") +set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -s") option(ENABLE_ASAN "Enable Google Sanitizer to find memory bugs" OFF) option(ENABLE_PREDICT_ARM64 "predict arm64" OFF) diff --git a/predict/src/CMakeLists.txt b/predict/src/CMakeLists.txt index c32c047c82..92c45473d7 100644 --- a/predict/src/CMakeLists.txt +++ b/predict/src/CMakeLists.txt @@ -52,20 +52,6 @@ else() target_link_libraries(mspredict pthread tvm_kernel libsecurec.a) endif() -if("${CMAKE_BUILD_TYPE}" STREQUAL "Release") - if(ENABLE_PREDICT_ARM64) - add_custom_command(TARGET mspredict POST_BUILD - COMMAND ${ANDROID_NDK}/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/aarch64-linux-android/bin/strip "${PREDICT_BUILD_DIR}/src/libmspredict.so" - COMMAND ${ANDROID_NDK}/toolchains/aarch64-linux-android-4.9/prebuilt/linux-x86_64/aarch64-linux-android/bin/strip "${PREDICT_BUILD_DIR}/module/tvm_kernel/lite/libtvm_kernel.so" - ) - else() - add_custom_command(TARGET mspredict POST_BUILD - COMMAND strip "${PREDICT_BUILD_DIR}/src/libmspredict.so" - COMMAND strip "${PREDICT_BUILD_DIR}/module/tvm_kernel/lite/libtvm_kernel.so" - ) - endif() -endif() - add_dependencies(mspredict tvm_kernel) add_dependencies(mspredict securec) add_dependencies(mspredict gtest)