From c8ef12910d28570ed8bb964c0a6cbd335c9ec927 Mon Sep 17 00:00:00 2001 From: Dominik Gleich Date: Thu, 23 Feb 2017 15:34:04 +0100 Subject: [PATCH] Add Ccache. Summary: Adding ccache option improves each additional build time by a big factor. Example of performance, modification to a header file: src/io/network/socket.hpp without ccache: real 0m26.950s user 1m18.636s sys 0m6.160s with ccache: real 0m10.644s user 0m30.616s sys 0m4.548s Reviewers: buda Reviewed By: buda Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D63 --- CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index a93ee08c0..053559741 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,6 +9,13 @@ if(NOT UNIX) message(FATAL "Unsupported operating system.") endif() +#look for ccache and set it up +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) + # choose a compiler # NOTE: must be choosen before use of project() or enable_language() ---------- set(CMAKE_C_COMPILER "clang")