cmake: Add support for ccache.

Enable ccache in CMake if CONFIG_CCACHE is set

Signed-off-by: Søren Friis <sfriis@gmail.com>
This commit is contained in:
Søren Friis
2025-12-03 20:49:43 +01:00
committed by simbit18
parent c47911ffa1
commit 1569621149

View File

@@ -426,6 +426,18 @@ if(CONFIG_ARCH_BOARD_COMMON)
"${NUTTX_DIR}/boards/${CONFIG_ARCH}/${CONFIG_ARCH_CHIP}/common")
endif()
# Setup ccache ###############################################################
if(CONFIG_CCACHE)
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM)
message(STATUS "Using ccache: ${CCACHE_PROGRAM}")
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
else()
message(STATUS "Could not find ccache, skipping!")
endif()
endif()
# Setup toolchain ############################################################
# This needs to happen before project() when binaries are searched for