fix compile error on libevent and grpc

Signed-off-by: zhoufeng <zhoufeng54@huawei.com>
This commit is contained in:
zhoufeng 2021-04-10 14:39:17 +08:00
parent c907c95da5
commit 534fa9bb6c
3 changed files with 14 additions and 1 deletions

View File

@ -1,6 +1,6 @@
set(libevent_CFLAGS "-fstack-protector-all -D_FORTIFY_SOURCE=2 -O2") set(libevent_CFLAGS "-fstack-protector-all -D_FORTIFY_SOURCE=2 -O2")
if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin") if(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
set(libevent_LDFLAGS "-Wl,-z,now") set(libevent_LDFLAGS "-Wl,-z,now -ldl")
endif() endif()
if(ENABLE_GITEE) if(ENABLE_GITEE)

View File

@ -11,3 +11,4 @@ mindspore_add_pkg(openssl
URL ${REQ_URL} URL ${REQ_URL}
MD5 ${MD5} MD5 ${MD5}
CONFIGURE_COMMAND ./config no-zlib no-shared) CONFIGURE_COMMAND ./config no-zlib no-shared)
include_directories(${openssl_INC})

View File

@ -10,3 +10,15 @@ diff -Npur grpc/CMakeLists.txt grpc-patch/CMakeLists.txt
target_include_directories(grpc_cpp_plugin target_include_directories(grpc_cpp_plugin
PRIVATE PRIVATE
${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}
diff -Npur grpc/cmake/cares.cmake grpc-patch/cmake/cares.cmake
--- grpc/cmake/cares.cmake 2020-02-27 03:12:33.000000000 +0800
+++ grpc-patch/cmake/cares.cmake 2021-04-10 14:22:35.895725700 +0800
@@ -39,7 +39,7 @@ if(gRPC_CARES_PROVIDER STREQUAL "module"
set(gRPC_INSTALL FALSE)
endif()
elseif(gRPC_CARES_PROVIDER STREQUAL "package")
- find_package(c-ares 1.13.0 REQUIRED)
+ find_package(c-ares REQUIRED) # cmake 3.19+ cannot find cares 1.15.0
if(TARGET c-ares::cares)
set(_gRPC_CARES_LIBRARIES c-ares::cares)
endif()