| ... | @@ -1,5 +1,11 @@ | ... | @@ -1,5 +1,11 @@ |
| 1 | cmake_minimum_required(VERSION 2.8.5) | 1 | cmake_minimum_required(VERSION 2.8.5) |
| 2 | | 2 | |
| | 3 | # Use ccache if possible |
| | 4 | FIND_PROGRAM(CCACHE_PROGRAM ccache) |
| | 5 | IF(CCACHE_PROGRAM) |
| | 6 | MESSAGE(STATUS "Found ccache ${CCACHE_PROGRAM}") |
| | 7 | ENDIF() |
| | 8 | |
| 3 | if(NOT CMAKE_BUILD_TYPE) | 9 | if(NOT CMAKE_BUILD_TYPE) |
| 4 | set(CMAKE_BUILD_TYPE "Debug" CACHE STRING | 10 | set(CMAKE_BUILD_TYPE "Debug" CACHE STRING |
| 5 | "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) | 11 | "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 | ... | @@ -47,6 +53,11 @@ set(ZIG_STATIC off CACHE BOOL "Attempt to build a static zig executable (not com |
| 47 | set(ZIG_STATIC_LLVM off CACHE BOOL "Prefer linking against static LLVM libraries") | 53 | set(ZIG_STATIC_LLVM off CACHE BOOL "Prefer linking against static LLVM libraries") |
| 48 | set(ZIG_ENABLE_MEM_PROFILE off CACHE BOOL "Activate memory usage instrumentation") | 54 | set(ZIG_ENABLE_MEM_PROFILE off CACHE BOOL "Activate memory usage instrumentation") |
| 49 | set(ZIG_PREFER_CLANG_CPP_DYLIB off CACHE BOOL "Try to link against -lclang-cpp") | 55 | set(ZIG_PREFER_CLANG_CPP_DYLIB off CACHE BOOL "Try to link against -lclang-cpp") |
| | 56 | set(ZIG_USE_CCACHE off CACHE BOOL "Use ccache if available") |
| | 57 | |
| | 58 | if(CCACHE_PROGRAM AND ZIG_USE_CCACHE) |
| | 59 | SET_PROPERTY(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}") |
| | 60 | endif() |
| 50 | | 61 | |
| 51 | if(ZIG_STATIC) | 62 | if(ZIG_STATIC) |
| 52 | set(ZIG_STATIC_LLVM "on") | 63 | set(ZIG_STATIC_LLVM "on") |