mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-01 18:50:34 +03:00
feat(cmakev2/idf): enable ccache if requested
Enable ccache if CCACHE_ENABLE is set. Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
This commit is contained in:
@@ -316,6 +316,25 @@ function(__init_toolchain)
|
||||
idf_build_set_property(IDF_TOOLCHAIN_FILE "${toolchain_file}")
|
||||
endfunction()
|
||||
|
||||
#[[
|
||||
__init_ccache()
|
||||
|
||||
Enable ccache if requested through CCACHE_ENABLE.
|
||||
#]]
|
||||
function(__init_ccache)
|
||||
if(NOT CCACHE_ENABLE)
|
||||
return()
|
||||
endif()
|
||||
|
||||
find_program(CCACHE_FOUND ccache)
|
||||
if(CCACHE_FOUND)
|
||||
idf_msg("ccache will be used for faster recompilation")
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
|
||||
else()
|
||||
idf_warn("enabled ccache in build but ccache program not found")
|
||||
endif()
|
||||
endfunction()
|
||||
|
||||
#[[
|
||||
__init_components()
|
||||
|
||||
@@ -565,6 +584,9 @@ __init_idf_target()
|
||||
# Set IDF_TOOLCHAIN, IDF_TOOLCHAIN_FILE and CMAKE_TOOLCHAIN_FILE.
|
||||
__init_toolchain()
|
||||
|
||||
# Enable ccache if requested.
|
||||
__init_ccache()
|
||||
|
||||
# Discover and initialize components.
|
||||
__init_components()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user