aboutsummaryrefslogtreecommitdiffhomepage
path: root/cmake/external/grpc.cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake/external/grpc.cmake')
-rw-r--r--cmake/external/grpc.cmake26
1 files changed, 20 insertions, 6 deletions
diff --git a/cmake/external/grpc.cmake b/cmake/external/grpc.cmake
index 1e8388c..a789838 100644
--- a/cmake/external/grpc.cmake
+++ b/cmake/external/grpc.cmake
@@ -24,7 +24,6 @@ else()
set(
GIT_SUBMODULES
third_party/boringssl
- third_party/cares/cares
)
set(
@@ -46,23 +45,37 @@ else()
)
+ ## c-ares
+ if(NOT c-ares_DIR)
+ set(c-ares_DIR ${FIREBASE_INSTALL_DIR}/lib/cmake/c-ares)
+ endif()
+
+ list(
+ APPEND CMAKE_ARGS
+ -DgRPC_CARES_PROVIDER:STRING=package
+ -Dc-ares_DIR:PATH=${c-ares_DIR}
+ )
+
+
## protobuf
# Unlike other dependencies of gRPC, we control the protobuf version because we
# have checked-in protoc outputs that must match the runtime.
# The location where protobuf-config.cmake will be installed varies by platform
- if (WIN32)
- set(PROTOBUF_CMAKE_DIR "${FIREBASE_INSTALL_DIR}/cmake")
- else()
- set(PROTOBUF_CMAKE_DIR "${FIREBASE_INSTALL_DIR}/lib/cmake/protobuf")
+ if(NOT Protobuf_DIR)
+ if(WIN32)
+ set(Protobuf_DIR "${FIREBASE_INSTALL_DIR}/cmake")
+ else()
+ set(Protobuf_DIR "${FIREBASE_INSTALL_DIR}/lib/cmake/protobuf")
+ endif()
endif()
list(
APPEND CMAKE_ARGS
-DgRPC_PROTOBUF_PROVIDER:STRING=package
-DgRPC_PROTOBUF_PACKAGE_TYPE:STRING=CONFIG
- -DProtobuf_DIR:PATH=${PROTOBUF_CMAKE_DIR}
+ -DProtobuf_DIR:PATH=${Protobuf_DIR}
)
@@ -94,6 +107,7 @@ else()
ExternalProject_Add(
grpc
DEPENDS
+ c-ares
protobuf
zlib