From 11b77d9daf13c1127a1f4c6f4137b9c9969e9da6 Mon Sep 17 00:00:00 2001 From: wxl Date: Wed, 17 Mar 2021 20:10:27 +0800 Subject: [PATCH] modify static depends --- cmake/external_libs/protobuf_static.cmake | 6 ++++++ ge/common/CMakeLists.txt | 4 ++-- ge/executor/CMakeLists.txt | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cmake/external_libs/protobuf_static.cmake b/cmake/external_libs/protobuf_static.cmake index 6f3e1f53..bf8249c1 100755 --- a/cmake/external_libs/protobuf_static.cmake +++ b/cmake/external_libs/protobuf_static.cmake @@ -1,3 +1,7 @@ +if (HAVE_PROTOBUF_STATIC) + return() +endif() + include(ExternalProject) include(GNUInstallDirs) #set(CMAKE_INSTALL_PREFIX ${GE_CODE_DIR}/output) @@ -57,3 +61,5 @@ include_directories(${PROTOBUF_STATIC_PKG_DIR}/include) endif () add_dependencies(ascend_protobuf_static protobuf_static_build) + +set(HAVE_PROTOBUF_STATIC TRUE) diff --git a/ge/common/CMakeLists.txt b/ge/common/CMakeLists.txt index 05838df8..79ee5f3d 100755 --- a/ge/common/CMakeLists.txt +++ b/ge/common/CMakeLists.txt @@ -12,7 +12,7 @@ set(PROTO_LIST "${METADEF_DIR}/proto/tensorflow/tensor.proto" "${METADEF_DIR}/proto/tensorflow/tensor_shape.proto" "${METADEF_DIR}/proto/tensorflow/types.proto" - "${METADEF_DIR}/proto/tensorflow/versions.proto" + "${METADEF_DIR}/proto/tensorflow/versions.proto" ) protobuf_generate(ge PROTO_SRCS PROTO_HDRS ${PROTO_LIST}) @@ -163,7 +163,7 @@ target_include_directories(ge_common_static PRIVATE target_link_libraries(ge_common_static PRIVATE $ - ascend_protobuf + ascend_protobuf_static json c_sec $<$>:-lrt> diff --git a/ge/executor/CMakeLists.txt b/ge/executor/CMakeLists.txt index d59afd03..84ad67d2 100644 --- a/ge/executor/CMakeLists.txt +++ b/ge/executor/CMakeLists.txt @@ -197,7 +197,7 @@ target_include_directories(ge_executor PRIVATE target_link_libraries(ge_executor PRIVATE $ json - ascend_protobuf + ascend_protobuf_static c_sec $<$>:-lrt> -ldl