Skip to content

Commit 425814e

Browse files
author
Steven Noonan
committed
travis: build with ccache
Helps with local build speed, especially if re-running. Signed-off-by: Steven Noonan <[email protected]>
1 parent a2c07d8 commit 425814e

File tree

6 files changed

+13
-3
lines changed

6 files changed

+13
-3
lines changed

.travis/build-cmake.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ cleanup
2828

2929
CMAKE_ARGS=(
3030
-G Ninja
31+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
32+
-DCMAKE_C_COMPILER_LAUNCHER=ccache
3133
-DLIGHT_TESTS:BOOL=ON
3234
-DWERROR=ON
3335
)

.travis/build.sh

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,22 @@ has cmake || has meson || die "No build system available"
5858
# We also need at least one compiler
5959
has_clang || has_gcc || die "No compiler available"
6060

61+
export CCACHE_DIR=$PWD/build-travis-ccache
62+
ccache -M4G
63+
6164
if has_clang; then
6265
msg "Beginning build tests with Clang"
63-
export CC=clang CXX=clang++
66+
export CC="ccache clang" CXX="ccache clang++"
6467
has meson && bash .travis/build-meson.sh
68+
export CC=clang CXX=clang++
6569
has cmake && bash .travis/build-cmake.sh
6670
fi
6771

6872
if has_gcc; then
6973
msg "Beginning build tests with GCC"
70-
export CC=gcc CXX=g++
74+
export CC="ccache gcc" CXX="ccache g++"
7175
has meson && bash .travis/build-meson.sh
76+
export CC=gcc CXX=g++
7277
has cmake && bash .travis/build-cmake.sh
7378
fi
7479

.travis/install-alpine.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ PACKAGES=(
1212
clang-dev
1313
gcc
1414
g++
15+
ccache
1516
cmake
1617
meson
1718
pkgconf

.travis/install-archlinux.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ set -ex
77
# Base build packages
88
PACKAGES=(
99
base-devel
10+
ccache
1011
clang
1112
cmake
1213
meson

.travis/install-fedora.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ PACKAGES=(
99
gcc-c++
1010
libasan
1111
libubsan
12+
ccache
1213
clang
1314
cmake
1415
meson

.travis/install-ubuntu.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ apt-get update
88
apt-get install -y locales
99
locale-gen en_US.UTF-8
1010

11-
PACKAGES=(build-essential pkg-config cmake meson clang)
11+
PACKAGES=(build-essential pkg-config ccache cmake meson clang)
1212

1313
PACKAGES+=(libprotobuf-dev protobuf-compiler)
1414
PACKAGES+=(libssl-dev)

0 commit comments

Comments
 (0)