Skip to content

Commit f058881

Browse files
authored
Convert cmake build to (mostly) use urls rather than git clones (firebase#852)
Exception: grpc. Due to it's use of git submodules, it's not completely trivial to convert it (though probably wouldn't be too much more work.) This helps address our build being throttled. (Maybe. This assumes github allows more fetching of tgz's than clones.) It should also speed up our build times. The downloaded tarballs are placed into ${PROJECT_BINARY_DIR}/downloads. This allows for eventual caching in travis.
1 parent a6c0e3f commit f058881

File tree

4 files changed

+15
-32
lines changed

4 files changed

+15
-32
lines changed

cmake/external/googletest.cmake

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,14 @@
1313
# limitations under the License.
1414

1515
include(ExternalProject)
16-
include(ExternalProjectFlags)
17-
18-
ExternalProject_GitSource(
19-
GOOGLETEST_GIT
20-
GIT_REPOSITORY "https://github.com/google/googletest.git"
21-
GIT_TAG "release-1.8.0"
22-
)
2316

2417
ExternalProject_Add(
2518
googletest
2619

27-
${GOOGLETEST_GIT}
20+
DOWNLOAD_DIR ${PROJECT_BINARY_DIR}/downloads
21+
DOWNLOAD_NAME googletest-1.8.0.tar.gz
22+
URL https://github.com/google/googletest/archive/release-1.8.0.tar.gz
23+
URL_HASH SHA256=58a6f4277ca2bc8565222b3bbd58a177609e9c488e8a72649359ba51450db7d8
2824

2925
PREFIX ${PROJECT_BINARY_DIR}/external/googletest
3026

cmake/external/leveldb.cmake

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
include(ExternalProject)
16-
include(ExternalProjectFlags)
1716

1817
if(WIN32 OR LEVELDB_ROOT)
1918
# If the user has supplied a LEVELDB_ROOT then just use it. Add an empty
@@ -42,16 +41,13 @@ else()
4241
$<$<CONFIG:Release>:${CMAKE_CXX_FLAGS_RELEASE}>"
4342
)
4443

45-
ExternalProject_GitSource(
46-
LEVELDB_GIT
47-
GIT_REPOSITORY "https://github.com/google/leveldb.git"
48-
GIT_TAG "v1.20"
49-
)
50-
5144
ExternalProject_Add(
5245
leveldb
5346

54-
${LEVELDB_GIT}
47+
DOWNLOAD_DIR ${PROJECT_BINARY_DIR}/downloads
48+
DOWNLOAD_NAME leveldb-v1.20.tar.gz
49+
URL https://github.com/google/leveldb/archive/v1.20.tar.gz
50+
URL_HASH SHA256=f5abe8b5b209c2f36560b75f32ce61412f39a2922f7045ae764a2c23335b6664
5551

5652
PREFIX ${PROJECT_BINARY_DIR}/external/leveldb
5753

cmake/external/nanopb.cmake

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,6 @@
1111
# limitations under the License.
1212

1313
include(ExternalProject)
14-
include(ExternalProjectFlags)
15-
16-
ExternalProject_GitSource(
17-
NANOPB_GIT
18-
GIT_REPOSITORY "https://github.com/nanopb/nanopb.git"
19-
GIT_TAG "0.3.8"
20-
)
2114

2215
set(
2316
NANOPB_PROTOC_BIN
@@ -29,7 +22,9 @@ ExternalProject_Add(
2922
DEPENDS
3023
protobuf
3124

32-
${NANOPB_GIT}
25+
DOWNLOAD_DIR ${PROJECT_BINARY_DIR}/downloads
26+
URL https://github.com/nanopb/nanopb/archive/nanopb-0.3.8.tar.gz
27+
URL_HASH SHA256=f192c7c7cc036be36babc303b7d2315d4f62e2fe4be28c172cfed4cfa0ed5f22
3328

3429
BUILD_IN_SOURCE ON
3530

cmake/external/protobuf.cmake

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,14 @@
1313
# limitations under the License.
1414

1515
include(ExternalProject)
16-
include(ExternalProjectFlags)
17-
18-
ExternalProject_GitSource(
19-
PROTOBUF_GIT
20-
GIT_REPOSITORY "https://github.com/google/protobuf.git"
21-
GIT_TAG "v3.5.1.1"
22-
)
2316

2417
ExternalProject_Add(
2518
protobuf
2619

27-
${PROTOBUF_GIT}
20+
DOWNLOAD_DIR ${PROJECT_BINARY_DIR}/downloads
21+
DOWNLOAD_NAME protobuf-v3.5.11.tar.gz
22+
URL https://github.com/google/protobuf/archive/v3.5.1.1.tar.gz
23+
URL_HASH SHA256=56b5d9e1ab2bf4f5736c4cfba9f4981fbc6976246721e7ded5602fbaee6d6869
2824

2925
PREFIX ${PROJECT_BINARY_DIR}/external/protobuf
3026

0 commit comments

Comments
 (0)