File tree Expand file tree Collapse file tree 9 files changed +59
-25
lines changed Expand file tree Collapse file tree 9 files changed +59
-25
lines changed Original file line number Diff line number Diff line change @@ -56,5 +56,6 @@ include(external/zlib)
56
56
include (external/leveldb )
57
57
include (external/protobuf )
58
58
include (external/nanopb )
59
+ include (external/c-ares )
59
60
include (external/grpc )
60
61
include (external/firestore )
Original file line number Diff line number Diff line change @@ -56,20 +56,10 @@ find_package(OpenSSL REQUIRED)
56
56
57
57
## C-Ares
58
58
59
- find_library (
60
- CARES_LIBRARY
61
- NAMES cares
62
- HINTS ${BINARY_DIR} /src/grpc-build/third_party/cares/cares/lib
63
- )
64
- if (NOT (CARES_LIBRARY STREQUAL "CARES_LIBRARY-NOTFOUND" ))
65
- if (NOT TARGET c-ares::ares )
66
- add_library (c-ares::ares UNKNOWN IMPORTED )
67
- set_target_properties (
68
- c-ares::ares PROPERTIES
69
- IMPORTED_LOCATION ${CARES_LIBRARY}
70
- )
71
- endif ()
59
+ if (NOT c-ares_DIR )
60
+ set (c-ares_DIR ${FIREBASE_INSTALL_DIR} /lib/cmake/c-ares )
72
61
endif ()
62
+ find_package (c-ares CONFIG REQUIRED )
73
63
74
64
75
65
## GRPC
@@ -124,7 +114,7 @@ if(GRPC_FOUND)
124
114
if (NOT TARGET grpc::grpc )
125
115
set (
126
116
GRPC_LINK_LIBRARIES
127
- c-ares::ares
117
+ c-ares::cares
128
118
grpc::gpr
129
119
OpenSSL::SSL
130
120
OpenSSL::Crypto
Original file line number Diff line number Diff line change
1
+ # Copyright 2018 Google
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ include (ExternalProject )
16
+
17
+ ExternalProject_Add (
18
+ c-ares
19
+
20
+ DOWNLOAD_DIR ${FIREBASE_DOWNLOAD_DIR}
21
+ URL https://github.com/c-ares/c-ares/archive/cares-1_14_0.tar.gz
22
+ URL_HASH SHA256=62dd12f0557918f89ad6f5b759f0bf4727174ae9979499f5452c02be38d9d3e8
23
+
24
+ PREFIX ${PROJECT_BINARY_DIR} /external/cares
25
+
26
+ CMAKE_ARGS
27
+ -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}
28
+ -DCMAKE_INSTALL_PREFIX:STRING=${FIREBASE_INSTALL_DIR}
29
+ -DCARES_STATIC:BOOL=ON
30
+ -DCARES_SHARED:BOOL=OFF
31
+ -DCARES_STATIC_PIC:BOOL=ON
32
+
33
+ TEST_COMMAND ""
34
+ )
Original file line number Diff line number Diff line change @@ -27,6 +27,5 @@ ExternalProject_Add(
27
27
CMAKE_CACHE_ARGS
28
28
-DCMAKE_INSTALL_PREFIX:STRING=${FIREBASE_INSTALL_DIR}
29
29
30
- UPDATE_COMMAND ""
31
30
TEST_COMMAND ""
32
31
)
Original file line number Diff line number Diff line change 24
24
set (
25
25
GIT_SUBMODULES
26
26
third_party/boringssl
27
- third_party/cares/cares
28
27
)
29
28
30
29
set (
@@ -46,23 +45,37 @@ else()
46
45
)
47
46
48
47
48
+ ## c-ares
49
+ if (NOT c-ares_DIR )
50
+ set (c-ares_DIR ${FIREBASE_INSTALL_DIR} /lib/cmake/c-ares )
51
+ endif ()
52
+
53
+ list (
54
+ APPEND CMAKE_ARGS
55
+ -DgRPC_CARES_PROVIDER:STRING=package
56
+ -Dc-ares_DIR:PATH=${c-ares_DIR}
57
+ )
58
+
59
+
49
60
## protobuf
50
61
51
62
# Unlike other dependencies of gRPC, we control the protobuf version because we
52
63
# have checked-in protoc outputs that must match the runtime.
53
64
54
65
# The location where protobuf-config.cmake will be installed varies by platform
55
- if (WIN32 )
56
- set (PROTOBUF_CMAKE_DIR "${FIREBASE_INSTALL_DIR} /cmake" )
57
- else ()
58
- set (PROTOBUF_CMAKE_DIR "${FIREBASE_INSTALL_DIR} /lib/cmake/protobuf" )
66
+ if (NOT Protobuf_DIR )
67
+ if (WIN32 )
68
+ set (Protobuf_DIR "${FIREBASE_INSTALL_DIR} /cmake" )
69
+ else ()
70
+ set (Protobuf_DIR "${FIREBASE_INSTALL_DIR} /lib/cmake/protobuf" )
71
+ endif ()
59
72
endif ()
60
73
61
74
list (
62
75
APPEND CMAKE_ARGS
63
76
-DgRPC_PROTOBUF_PROVIDER:STRING=package
64
77
-DgRPC_PROTOBUF_PACKAGE_TYPE:STRING=CONFIG
65
- -DProtobuf_DIR:PATH=${PROTOBUF_CMAKE_DIR }
78
+ -DProtobuf_DIR:PATH=${Protobuf_DIR }
66
79
)
67
80
68
81
@@ -94,6 +107,7 @@ else()
94
107
ExternalProject_Add (
95
108
grpc
96
109
DEPENDS
110
+ c-ares
97
111
protobuf
98
112
zlib
99
113
Original file line number Diff line number Diff line change 66
66
67
67
INSTALL_DIR ${FIREBASE_INSTALL_DIR}
68
68
69
- UPDATE_COMMAND ""
70
69
INSTALL_COMMAND ""
71
70
TEST_COMMAND ""
72
71
)
Original file line number Diff line number Diff line change @@ -34,6 +34,5 @@ ExternalProject_Add(
34
34
-Dnanopb_BUILD_GENERATOR:BOOL=ON
35
35
-Dnanopb_PROTOC_PATH:STRING=${NANOPB_PROTOC_BIN}
36
36
37
- UPDATE_COMMAND ""
38
37
TEST_COMMAND ""
39
38
)
Original file line number Diff line number Diff line change @@ -105,6 +105,5 @@ ExternalProject_Add(
105
105
106
106
${commands}
107
107
108
- UPDATE_COMMAND ""
109
108
TEST_COMMAND ""
110
109
)
Original file line number Diff line number Diff line change 35
35
-DCMAKE_INSTALL_PREFIX:STRING=${FIREBASE_INSTALL_DIR}
36
36
-DBUILD_SHARED_LIBS:BOOL=OFF
37
37
38
- UPDATE_COMMAND ""
39
38
TEST_COMMAND ""
40
39
)
41
40
endif ()
You can’t perform that action at this time.
0 commit comments