From aa9cff315d659a7ca2010fb4791893abc8c5abdb Mon Sep 17 00:00:00 2001 From: Yuri Date: Fri, 2 Mar 2018 21:25:53 -0800 Subject: [PATCH] feat: Add the cmake option USE_CCACHE --- CMakeLists.txt | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 37ee8aca9..92b128ff6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -11,6 +11,7 @@ option(PLATFORM_EXTENSIONS "Enable platform specific extensions, requires extra option(USE_FILTERAUDIO "Enable the echo canceling backend" ON) # AUTOUPDATE is currently broken and thus disabled option(AUTOUPDATE "Enable the auto updater" OFF) +option(USE_CCACHE "Use ccache when available" ON) if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE Debug) @@ -69,10 +70,16 @@ endif() # 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") +if (USE_CCACHE) + find_program(CCACHE_FOUND ccache) + if(CCACHE_FOUND) + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) + message(STATUS "using ccache") + else() + message(STATUS "ccache not found") + endif() +else() + message(STATUS "ccache disabled; set option USE_CCACHE=ON to use ccache if available") endif() # Search for headers in current directory.