Skip to content

Commit d953327

Browse files
committed
Enable caching for CMake builds (hopefully)
1 parent 6251055 commit d953327

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

.travis.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ jobs:
153153

154154
- stage: Test different OS/CXX/Flags
155155
os: linux
156+
cache: ccache
156157
env:
157158
- BUILD_SYSTEM=cmake
158159
addons:
@@ -162,22 +163,20 @@ jobs:
162163
packages:
163164
- g++-5
164165
install:
165-
- mkdir build
166-
- cmake -Bbuild -H. '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_CXX_COMPILER=g++-5'
166+
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_CXX_FLAGS_RELEASE=-O3' '-DCMAKE_CXX_FLAGS=-Wall -Wpedantic -Werror' '-DCMAKE_CXX_COMPILER=g++-5'
167167
- cmake --build build -- -j4
168168
script: (cd build; ctest -V -L CORE)
169-
before_cache:
170169

171170
- stage: Test different OS/CXX/Flags
172171
os: osx
172+
cache: ccache
173173
env:
174174
- BUILD_SYSTEM=cmake
175+
- CCACHE_CPP2=yes
175176
install:
176-
- mkdir build
177-
- cmake -Bbuild -H. '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_OSX_ARCHITECTURES=i386;x86_64'
177+
- cmake -H. -Bbuild '-DCMAKE_BUILD_TYPE=Release' '-DCMAKE_CXX_FLAGS_RELEASE=-O3' '-DCMAKE_CXX_FLAGS=-Wall -Wpedantic -Werror' '-DCMAKE_OSX_ARCHITECTURES=i386;x86_64'
178178
- cmake --build build -- -j4
179179
script: (cd build; ctest -V -L CORE)
180-
before_cache:
181180

182181

183182
allow_failures:

CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
cmake_minimum_required(VERSION 3.2)
22

3+
find_program(CCACHE_PROGRAM ccache)
4+
if(CCACHE_PROGRAM)
5+
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
6+
endif()
7+
38
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.9)
49

510
include(GNUInstallDirs)

0 commit comments

Comments
 (0)