From ad70693999ad42265b39908d2388d616b85f13b9 Mon Sep 17 00:00:00 2001 From: Konstantinos Margaritis Date: Tue, 12 Dec 2023 10:18:54 +0200 Subject: [PATCH] use ccache if available --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 30c8663e..d256e7ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -35,6 +35,13 @@ if(${RAGEL} STREQUAL "RAGEL-NOTFOUND") message(FATAL_ERROR "Ragel state machine compiler not found") endif() +# Add ccache to speed builds +find_program(CCACHE_FOUND ccache) +if(CCACHE_FOUND) + set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) + set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) +endif(CCACHE_FOUND) + # Build type check if (NOT CMAKE_BUILD_TYPE)