From f0f72ebe1461e26d02d32828c7c72fccb8929e22 Mon Sep 17 00:00:00 2001 From: Rafael Lee Date: Fri, 26 Aug 2022 04:35:10 +0800 Subject: [PATCH] feat(ccache): Add ccache for unix building systems --- tools/cmake/idf.cmake | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tools/cmake/idf.cmake b/tools/cmake/idf.cmake index e97d83fcd..51c7e9b3a 100644 --- a/tools/cmake/idf.cmake +++ b/tools/cmake/idf.cmake @@ -43,4 +43,11 @@ if(NOT __idf_env_set) __build_init("${idf_path}") set_property(GLOBAL PROPERTY __IDF_ENV_SET 1) +endif() + +find_program(CCACHE_PROGRAM ccache) +if(CCACHE_PROGRAM) + # Support Unix Makefiles and Ninja + set(CMAKE_C_COMPILER_LAUNCHER "ccache") + set(CMAKE_CXX_COMPILER_LAUNCHER "ccache") endif() \ No newline at end of file