From 3fa7a0646e60f9f0dd0782cadf13e0dff648dcca Mon Sep 17 00:00:00 2001 From: Yuan Shuai Date: Thu, 7 Nov 2019 20:22:34 +0800 Subject: [PATCH] [LITE][CMAKE] Add strip check for publish_inference_cxx_lib, publish_inference_java_lib (#2328) * Add CMAKE_BUILD_TYPE check for strip. test=develop --- lite/CMakeLists.txt | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lite/CMakeLists.txt b/lite/CMakeLists.txt index fa55e27255..71914a8a34 100644 --- a/lite/CMakeLists.txt +++ b/lite/CMakeLists.txt @@ -143,8 +143,10 @@ if (LITE_WITH_LIGHT_WEIGHT_FRAMEWORK AND LITE_WITH_ARM) COMMAND cp ${CMAKE_BINARY_DIR}/lite/api/*.so ${INFER_LITE_PUBLISH_ROOT}/cxx/lib) endif() add_dependencies(publish_inference publish_inference_cxx_lib) - add_custom_command(TARGET publish_inference_cxx_lib POST_BUILD - COMMAND ${CMAKE_STRIP} "--strip-debug" ${INFER_LITE_PUBLISH_ROOT}/cxx/lib/*.a) + if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + add_custom_command(TARGET publish_inference_cxx_lib POST_BUILD + COMMAND ${CMAKE_STRIP} "--strip-debug" ${INFER_LITE_PUBLISH_ROOT}/cxx/lib/*.a) + endif() endif() else() if (IOS) @@ -183,8 +185,10 @@ if (LITE_WITH_LIGHT_WEIGHT_FRAMEWORK AND LITE_WITH_ARM) ) add_dependencies(publish_inference_java_lib paddle_lite_jni PaddlePredictor) add_dependencies(publish_inference publish_inference_java_lib) - add_custom_command(TARGET publish_inference_java_lib POST_BUILD - COMMAND ${CMAKE_STRIP} "-s" ${INFER_LITE_PUBLISH_ROOT}/java/so/libpaddle_lite_jni.so) + if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug") + add_custom_command(TARGET publish_inference_java_lib POST_BUILD + COMMAND ${CMAKE_STRIP} "-s" ${INFER_LITE_PUBLISH_ROOT}/java/so/libpaddle_lite_jni.so) + endif() endif() if ((ARM_TARGET_OS STREQUAL "android") AND (NOT LITE_WITH_OPENCL) AND -- GitLab