From a14892773c3521f6c1e4852eec75f38f06663355 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 25 Jan 2017 09:05:27 +0100 Subject: [PATCH] Added CCACHE detection and option to disable. --- CMakeLists.txt | 6 ++++++ cmake/ConfigOptions.cmake | 1 + 2 files changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 654aa5e26..8b65c735a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -107,6 +107,12 @@ if(CMAKE_CROSSCOMPILING) SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM BOTH) endif(CMAKE_CROSSCOMPILING) +find_program(CCACHE ccache) +if(CCACHE AND WITH_CCACHE) + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ${CCACHE}) + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ${CCACHE}) +endif(CCACHE AND WITH_CCACHE) + include(GetGitRevisionDescription) git_get_exact_tag(GIT_REVISION --tags --always) diff --git a/cmake/ConfigOptions.cmake b/cmake/ConfigOptions.cmake index af181c845..905863eed 100644 --- a/cmake/ConfigOptions.cmake +++ b/cmake/ConfigOptions.cmake @@ -128,6 +128,7 @@ option(WITH_DEBUG_XV "Print XVideo debug messages" ${DEFAULT_DEBUG_OPTION}) option(WITH_DEBUG_RINGBUFFER "Enable Ringbuffer debug messages" ${DEFAULT_DEBUG_OPTION}) option(WITH_DEBUG_SYMBOLS "Pack debug symbols to installer" OFF) +option(WITH_CCACHE "Use ccache support if available" ON) if(ANDROID) include(ConfigOptionsAndroid)