Commit e8e547ae85a495fd7eb36290403097b7a52756da

Authored by Omer Katz
Committed by GitHub
1 parent b62172a1

Enable ccache if found for faster builds.

Showing 1 changed file with 9 additions and 0 deletions
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  
... ...