From 0834bbd0b108b7ddc66f963be657d6719515a687 Mon Sep 17 00:00:00 2001 From: qinzuoyan Date: Fri, 31 May 2019 10:40:39 -0700 Subject: [PATCH] Configure ccache in CMakeLists.txt to speed up compilation Summary: Pull Request resolved: https://github.com/facebook/rocksdb/pull/5388 Differential Revision: D15579052 Pulled By: siying fbshipit-source-id: ee58770fe023f40b9aa189a225e4c7ef50613ea9 --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3ddea95de..9a4d9deb1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -44,6 +44,12 @@ endif() list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/cmake/modules/") +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) + option(WITH_JEMALLOC "build with JeMalloc" OFF) option(WITH_SNAPPY "build with SNAPPY" OFF) option(WITH_LZ4 "build with lz4" OFF)