Skip to content

Commit d00c03d

Browse files
committed
Introducing "enable_ccache" switch (default on) into our build system.
1 parent f079156 commit d00c03d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

CMakeLists.txt

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
cmake_minimum_required(VERSION 3.2)
22

3+
set(enable_ccache on CACHE BOOL "Whether CCACHE should be used or not when building targets (applies only for Makefile and Ninja generators).")
34
find_program(CCACHE_PROGRAM ccache)
4-
if(CCACHE_PROGRAM)
5+
if(CCACHE_PROGRAM AND enable_ccache)
56
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
67
message(STATUS "Rule launch compile: ${CCACHE_PROGRAM}")
7-
endif()
8+
else()
9+
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "")
10+
message(STATUS "Rule launch compile: '${RULE_LAUNCH_COMPILE}'")
11+
endif()
812

913
set(CMAKE_EXPORT_COMPILE_COMMANDS true)
1014

0 commit comments

Comments
 (0)