chore(build): make cmake use ccache when it's available

Found in
https://stackoverflow.com/questions/1815688/how-to-use-ccache-with-cmake
reviewable/pr4057/r2
Zetok Zalbavar 2017-01-08 13:36:31 +00:00
parent c4fb84e83e
commit a143cf3e9e
No known key found for this signature in database
GPG Key ID: C953D3880212068A
1 changed files with 7 additions and 0 deletions

View File

@ -43,6 +43,13 @@ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-rtti")
# Use ccache when available to speed up builds.
find_program(CCACHE_FOUND ccache)
if(CCACHE_FOUND)
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
message(STATUS "using ccache")
endif()
# Search for headers in current directory.
include_directories(${CMAKE_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR})