Skip to content

Commit 7dfbd3d

Browse files
authored
Merge pull request diffblue#77 from diffblue/feature/enable-cache
Enable ccache on Travis
2 parents 64f5322 + 9ba196c commit 7dfbd3d

File tree

1 file changed

+20
-7
lines changed

1 file changed

+20
-7
lines changed

.travis.yml

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,27 @@ matrix:
1111
- os: osx
1212
sudo: false
1313
compiler: gcc
14-
before_install: brew install jq
15-
env: COMPILER=g++
14+
cache: ccache
15+
before_install:
16+
- brew install jq ccache
17+
- export PATH=/usr/local/opt/ccache/libexec:$PATH
18+
env: COMPILER="ccache g++"
1619

1720
# OS X using clang++
1821
- os: osx
1922
sudo: false
2023
compiler: clang
21-
before_install: brew install jq
22-
env: COMPILER=clang++
24+
cache: ccache
25+
before_install:
26+
- brew install jq ccache
27+
- export PATH=/usr/local/opt/ccache/libexec:$PATH
28+
env: COMPILER="ccache clang++ -Qunused-arguments -fcolor-diagnostics"
2329

2430
# Ubuntu Linux with glibc using g++-5
2531
- os: linux
2632
sudo: false
2733
compiler: gcc
34+
cache: ccache
2835
addons:
2936
apt:
3037
sources:
@@ -35,12 +42,13 @@ matrix:
3542
- libubsan0
3643
before_install:
3744
- mkdir bin ; ln -s /usr/bin/gcc-5 bin/gcc
38-
env: COMPILER=g++-5
45+
env: COMPILER="ccache g++-5"
3946

4047
# Ubuntu Linux with glibc using clang++-3.7
4148
- os: linux
4249
sudo: false
4350
compiler: clang
51+
cache: ccache
4452
addons:
4553
apt:
4654
sources:
@@ -53,7 +61,9 @@ matrix:
5361
- libubsan0
5462
before_install:
5563
- mkdir bin ; ln -s /usr/bin/clang-3.7 bin/gcc
56-
env: COMPILER=clang++-3.7
64+
env:
65+
- COMPILER="ccache clang++-3.7 -Qunused-arguments -fcolor-diagnostics"
66+
- CCACHE_CPP2=yes
5767

5868
- env: NAME="CPP-LINT"
5969
addons:
@@ -71,6 +81,7 @@ matrix:
7181
- libwww-perl
7282
script:
7383
- git fetch origin $TRAVIS_BRANCH && git branch $TRAVIS_BRANCH FETCH_HEAD && cbmc/scripts/travis_lint.sh
84+
before_cache:
7485

7586
install:
7687
- if [ -L bin/gcc ] ; then export PATH=$PWD/bin:$PATH ; fi ;
@@ -90,11 +101,13 @@ install:
90101
# Run within host machine to setup CBMC remotes
91102
- make setup-cbmc
92103

104+
before_cache: ccache -s
105+
93106
script:
94107
- |
95108
# Compile in host machine/container & run tests in host machine/container
96109
if [ -L bin/gcc ] ; then export PATH=$PWD/bin:$PATH ; fi ;
97-
COMMAND="make -C src CXX=$COMPILER CXXFLAGS=\"-Wall -O2 -g -Werror -Wno-deprecated-register -pedantic -Wno-sign-compare -DUSE_BOOST\"" &&
110+
COMMAND="make -C src CXX=\"$COMPILER\" CXXFLAGS=\"-Wall -O2 -g -Werror -Wno-deprecated-register -pedantic -Wno-sign-compare -DUSE_BOOST\"" &&
98111
eval ${PRE_COMMAND} ${COMMAND}
99112
100113
notifications:

0 commit comments

Comments
 (0)