From 043e4569b41fde85f70825ddf502dce405240884 Mon Sep 17 00:00:00 2001 From: taoxudonghaha Date: Thu, 18 Feb 2021 14:28:16 +0800 Subject: [PATCH] modify static depends --- cmake/external_libs/protobuf_static.cmake | 6 ++++++ ge/common/CMakeLists.txt | 2 +- ge/executor/CMakeLists.txt | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cmake/external_libs/protobuf_static.cmake b/cmake/external_libs/protobuf_static.cmake index e4bbb9a0..22f537cf 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) @@ -58,3 +62,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 22b1a7ea..c73e21c6 100755 --- a/ge/common/CMakeLists.txt +++ b/ge/common/CMakeLists.txt @@ -170,7 +170,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 05d627de..56c8efd4 100644 --- a/ge/executor/CMakeLists.txt +++ b/ge/executor/CMakeLists.txt @@ -202,7 +202,7 @@ target_include_directories(ge_executor SYSTEM PRIVATE target_link_libraries(ge_executor PRIVATE $ json - ascend_protobuf + ascend_protobuf_static c_sec $<$>:-lrt> -ldl