From b04dfcd43dad4e9a803efc79c770c9d78226e853 Mon Sep 17 00:00:00 2001 From: Bartosz Taudul Date: Fri, 21 Feb 2025 23:27:15 +0100 Subject: [PATCH] Use ccache if available. --- cmake/config.cmake | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cmake/config.cmake b/cmake/config.cmake index 00cb12af..d563c225 100644 --- a/cmake/config.cmake +++ b/cmake/config.cmake @@ -51,6 +51,12 @@ if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_SYSTEM_NAME STREQUAL "Linux" endif() endif() +find_program(CCACHE ccache) +if(CCACHE) + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) +endif() + file(GENERATE OUTPUT .gitignore CONTENT "*") set(CMAKE_COLOR_DIAGNOSTICS ON)