Commit 232e3f6210fa61cc00e7d3c4f6fea6ec2c0d15d1

Authored by Hayk Martirosyan
Committed by GitHub
2 parents b62172a1 01c69d45

Merge pull request #51 from thedrow/patch-1

Enable ccache if found for faster builds
Showing 2 changed files with 10 additions and 0 deletions
.travis.yml
1 1 # Enable C++ support
2 2 language: cpp
  3 +cache: ccache
3 4 # OS
4 5 sudo: required
5 6 dist: trusty
... ...
CMakeLists.txt
... ... @@ -19,6 +19,15 @@ endif(NOT CMAKE_CONFIGURATION_TYPES AND NOT CMAKE_BUILD_TYPE)
19 19 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -fPIC -Wall")
20 20 set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
21 21  
  22 +find_program(CCACHE_FOUND ccache)
  23 +if(CCACHE_FOUND)
  24 + message("Found ccache ${CCACHE_FOUND}")
  25 + message("Using ccache to speed up compilation")
  26 + set(ENV{CCACHE_CPP2} "yes")
  27 + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
  28 + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache)
  29 +endif(CCACHE_FOUND)
  30 +
22 31 # Print out compiler commands
23 32 # set(CMAKE_VERBOSE_MAKEFILE ON)
24 33  
... ...