From: Renz Christian Bagaporo Date: Mon, 6 May 2019 11:57:45 +0000 (+0800) Subject: cmake: restore ccache use when present X-Git-Tag: v4.0-beta1~350^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=459dd29444d048a67b1f05d2c8dbacdb6634a3b0;p=esp-idf cmake: restore ccache use when present Closes https://github.com/espressif/esp-idf/issues/3116 --- diff --git a/tools/cmake/project.cmake b/tools/cmake/project.cmake index 034566e7fc..1bf088c3f8 100644 --- a/tools/cmake/project.cmake +++ b/tools/cmake/project.cmake @@ -83,6 +83,15 @@ macro(project name) # Now the configuration is loaded, set the toolchain appropriately idf_set_toolchain() + # Enable ccache if it's on the path + if(NOT CCACHE_DISABLE) + find_program(CCACHE_FOUND ccache) + if(CCACHE_FOUND) + message(STATUS "ccache will be used for faster builds") + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) + endif() + endif() + __project(${name} C CXX ASM) set(IDF_BUILD_ARTIFACTS ON)