From e2f036e8e9bcc0b6d3cbeec7865ccf8c724c2bc5 Mon Sep 17 00:00:00 2001 From: Paul Robinson Date: Wed, 24 Jan 2018 18:15:08 +0000 Subject: [PATCH] Fix up and document controlling ccache via CMake options. Patch by Matthew Davis! Differential Revision: https://reviews.llvm.org/D41757 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@323357 91177308-0d34-0410-b5e6-96231b3b80d8 --- CMakeLists.txt | 6 +++--- docs/CMake.rst | 8 ++++++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1d06bb2f5ec..198dbff3144 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -137,11 +137,11 @@ set(LLVM_CCACHE_BUILD OFF CACHE BOOL "Set to ON for a ccache enabled build") if(LLVM_CCACHE_BUILD) find_program(CCACHE_PROGRAM ccache) if(CCACHE_PROGRAM) - set(LLVM_CCACHE_SIZE "" CACHE STRING "Size of ccache") + set(LLVM_CCACHE_MAXSIZE "" CACHE STRING "Size of ccache") set(LLVM_CCACHE_DIR "" CACHE STRING "Directory to keep ccached data") set(CCACHE_PROGRAM "CCACHE_CPP2=yes CCACHE_HASHDIR=yes ${CCACHE_PROGRAM}") - if (LLVM_CCACHE_SIZE) - set(CCACHE_PROGRAM "CCACHE_SIZE=${LLVM_CCACHE_SIZE} ${CCACHE_PROGRAM}") + if (LLVM_CCACHE_MAXSIZE) + set(CCACHE_PROGRAM "CCACHE_MAXSIZE=${LLVM_CCACHE_MAXSIZE} ${CCACHE_PROGRAM}") endif() if (LLVM_CCACHE_DIR) set(CCACHE_PROGRAM "CCACHE_DIR=${LLVM_CCACHE_DIR} ${CCACHE_PROGRAM}") diff --git a/docs/CMake.rst b/docs/CMake.rst index 05edec64da3..5fea12801c5 100644 --- a/docs/CMake.rst +++ b/docs/CMake.rst @@ -551,6 +551,14 @@ LLVM-specific variables `_ instrumentation is enabled while building llvm. +**LLVM_CCACHE_BUILD**:BOOL + If enabled and the ``ccache`` program is available, then LLVM will be + built using ``ccache`` to speed up rebuilds of LLVM and its components. + Defaults to OFF. The size and location of the cache maintained + by ``ccache`` can be adjusted via the LLVM_CCACHE_MAXSIZE and LLVM_CCACHE_DIR + options, which are passed to the CCACHE_MAXSIZE and CCACHE_DIR environment + variables, respectively. + CMake Caches ============