提交 3fa7a064 编写于 作者: Y Yuan Shuai 提交者: GitHub

[LITE][CMAKE] Add strip check for publish_inference_cxx_lib, publish_inference_java_lib (#2328)

* Add CMAKE_BUILD_TYPE check for strip. test=develop
上级 6b38eab8
...@@ -143,8 +143,10 @@ if (LITE_WITH_LIGHT_WEIGHT_FRAMEWORK AND LITE_WITH_ARM) ...@@ -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) COMMAND cp ${CMAKE_BINARY_DIR}/lite/api/*.so ${INFER_LITE_PUBLISH_ROOT}/cxx/lib)
endif() endif()
add_dependencies(publish_inference publish_inference_cxx_lib) add_dependencies(publish_inference publish_inference_cxx_lib)
add_custom_command(TARGET publish_inference_cxx_lib POST_BUILD if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
COMMAND ${CMAKE_STRIP} "--strip-debug" ${INFER_LITE_PUBLISH_ROOT}/cxx/lib/*.a) add_custom_command(TARGET publish_inference_cxx_lib POST_BUILD
COMMAND ${CMAKE_STRIP} "--strip-debug" ${INFER_LITE_PUBLISH_ROOT}/cxx/lib/*.a)
endif()
endif() endif()
else() else()
if (IOS) if (IOS)
...@@ -183,8 +185,10 @@ if (LITE_WITH_LIGHT_WEIGHT_FRAMEWORK AND LITE_WITH_ARM) ...@@ -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_java_lib paddle_lite_jni PaddlePredictor)
add_dependencies(publish_inference publish_inference_java_lib) add_dependencies(publish_inference publish_inference_java_lib)
add_custom_command(TARGET publish_inference_java_lib POST_BUILD if(NOT "${CMAKE_BUILD_TYPE}" STREQUAL "Debug")
COMMAND ${CMAKE_STRIP} "-s" ${INFER_LITE_PUBLISH_ROOT}/java/so/libpaddle_lite_jni.so) 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() endif()
if ((ARM_TARGET_OS STREQUAL "android") AND (NOT LITE_WITH_OPENCL) AND if ((ARM_TARGET_OS STREQUAL "android") AND (NOT LITE_WITH_OPENCL) AND
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册