authorgravatar for datamanrb@gmail.comdata-man <datamanrb@gmail.com> 2020-05-26 18:36:55+05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2020-05-26 16:04:40-04:00
logb6e1670d2ba1e7724878ee2b7176077da5cb7c35
treed6afe0d73794c3bab00c7be006a48504963878c8
parente1186c88eaed414d4e93d05a882c27c641d5e6ab

Use ccache (optionally)


1 files changed, 11 insertions(+), 0 deletions(-)

CMakeLists.txt+11
......@@ -1,5 +1,11 @@
11cmake_minimum_required(VERSION 2.8.5)
22
3# Use ccache if possible
4FIND_PROGRAM(CCACHE_PROGRAM ccache)
5IF(CCACHE_PROGRAM)
6 MESSAGE(STATUS "Found ccache ${CCACHE_PROGRAM}")
7ENDIF()
8
39if(NOT CMAKE_BUILD_TYPE)
410 set(CMAKE_BUILD_TYPE "Debug" CACHE STRING
511 "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE)
......@@ -47,6 +53,11 @@ set(ZIG_STATIC off CACHE BOOL "Attempt to build a static zig executable (not com
4753set(ZIG_STATIC_LLVM off CACHE BOOL "Prefer linking against static LLVM libraries")
4854set(ZIG_ENABLE_MEM_PROFILE off CACHE BOOL "Activate memory usage instrumentation")
4955set(ZIG_PREFER_CLANG_CPP_DYLIB off CACHE BOOL "Try to link against -lclang-cpp")
56set(ZIG_USE_CCACHE off CACHE BOOL "Use ccache if available")
57
58if(CCACHE_PROGRAM AND ZIG_USE_CCACHE)
59 SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
60endif()
5061
5162if(ZIG_STATIC)
5263 set(ZIG_STATIC_LLVM "on")