Files
L4D2Fix/cmake/AutoCCache.cmake
T
2024-12-02 12:07:36 +08:00

11 lines
431 B
CMake

# From https://gist.github.com/cgmb/c48bfa77da6c825a27bf05d25001d321
option(AUTO_CCACHE "Use ccache to speed up rebuilds" ON)
find_program(CCACHE_PROGRAM ccache)
if(CCACHE_PROGRAM AND ${AUTO_CCACHE})
message(STATUS "Using ${CCACHE_PROGRAM} as compiler launcher")
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
# requires at least CMake 3.9 to be any use
set(CMAKE_CUDA_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
endif()