Skip to content

Commit a5727ac

Browse files
authored
Cache ccache output (#4611)
This should reuse object files from unchanged sources between builds. This brings a rebuild of the Firestore CMake build down from 20 min 37 sec, to 9 min 13 sec: * Before: https://travis-ci.org/firebase/firebase-ios-sdk/jobs/635423433 * After: https://travis-ci.org/firebase/firebase-ios-sdk/jobs/635295223 #no-changelog
1 parent afb5638 commit a5727ac

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.travis.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@ os: osx
22
osx_image: xcode11.3
33
language: objective-c
44
cache:
5-
- bundler
6-
- cocoapods
5+
bundler: true
6+
cocoapods: true
7+
directories:
8+
# Built-in support for ccache doesn't seem to pick this up
9+
- $HOME/.ccache
710

811
stages:
912
- checks

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ endif()
4343
# Enable the ccache compilation cache, if available.
4444
find_program(CCACHE_PROGRAM ccache)
4545
if(CCACHE_PROGRAM)
46+
message(STATUS "Found ccache: ${CCACHE_PROGRAM}")
4647
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
4748
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
4849
endif()

scripts/install_prereqs.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ case "$PROJECT-$PLATFORM-$METHOD" in
126126
Firestore-*-cmake)
127127
brew outdated cmake || brew upgrade cmake
128128
brew outdated go || brew upgrade go # Somehow the build for Abseil requires this.
129+
brew install ccache
129130

130131
# Install python packages required to generate proto sources
131132
pip install six

0 commit comments

Comments
 (0)