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