From 1192ed9fb3c9e7713b299ab52c78064d6e361e0a Mon Sep 17 00:00:00 2001 From: Semenov Herman Date: Wed, 28 Aug 2024 01:38:09 +0300 Subject: [PATCH] cmake: integrate ccache for decrease repeat compiling time on Linux and BSD --- CMakeLists.txt | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6450eaf1..6f2035c5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -109,6 +109,14 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "Ap endif() endif() +# Setup ccache if package installed +find_program(CCACHE_ENABLED "ccache") +if (CCACHE_ENABLED) + set(CMAKE_C_COMPILER_LAUNCHER ${CCACHE}) + set(CMAKE_CXX_COMPILER_LAUNCHER ${CCACHE}) + set(ENV{CCACHE_SLOPPINESS} pch_defines,time_macros) +endif() + add_subdirectory(externals) include_directories(src)