diff options
author | Matt Hill <theothermatt> | 2020-12-21 08:17:35 +0300 |
---|---|---|
committer | Ankit Meel <ankitjmeel@gmail.com> | 2020-12-21 08:17:35 +0300 |
commit | fdb7623e098fe431397815fc67667c5904074913 (patch) | |
tree | 3ce2e718b5e9fee8f330c85925b88d6013226580 /CMakeLists.txt | |
parent | 84cc00f3b68e12209e000008f992fad3ac48f757 (diff) |
Unix/macOS: support building with Ccache
This adds an option (WITH_COMPILER_CCACHE) to build using Ccache if it's
found. Makefiles-based, Ninja-based and Xcode generators are supported.
Pass `-DWITH_COMPILER_CCACHE=ON` to cmake to enable Ccache.
Utility option in GNUmakefile is also added: for e.g.,
`make ninja ccache`.
Reviewed By: brecht, ankitm
Differential Revision: https://developer.blender.org/D9665
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index c8ae562f6ad..a630f0ae63d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -610,6 +610,11 @@ if(WIN32) endif() +if(UNIX) + # See WITH_WINDOWS_SCCACHE for Windows. + option(WITH_COMPILER_CCACHE "Use ccache to improve rebuild times (Works with Ninja, Makefiles and Xcode)" OFF) +endif() + # The following only works with the Ninja generator in CMake >= 3.0. if("${CMAKE_GENERATOR}" MATCHES "Ninja") option(WITH_NINJA_POOL_JOBS |