Skip to content

Commit 1569621

Browse files
sorenfriissimbit18
authored andcommitted
cmake: Add support for ccache.
Enable ccache in CMake if CONFIG_CCACHE is set Signed-off-by: Søren Friis <sfriis@gmail.com>
1 parent c47911f commit 1569621

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

CMakeLists.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,18 @@ if(CONFIG_ARCH_BOARD_COMMON)
426426
"${NUTTX_DIR}/boards/${CONFIG_ARCH}/${CONFIG_ARCH_CHIP}/common")
427427
endif()
428428

429+
# Setup ccache ###############################################################
430+
431+
if(CONFIG_CCACHE)
432+
find_program(CCACHE_PROGRAM ccache)
433+
if(CCACHE_PROGRAM)
434+
message(STATUS "Using ccache: ${CCACHE_PROGRAM}")
435+
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache)
436+
else()
437+
message(STATUS "Could not find ccache, skipping!")
438+
endif()
439+
endif()
440+
429441
# Setup toolchain ############################################################
430442

431443
# This needs to happen before project() when binaries are searched for

0 commit comments

Comments
 (0)