diff --git a/CMakeLists.txt b/CMakeLists.txt index 76a44a27..1460faba 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,14 @@ cmake_minimum_required(VERSION 3.10) project(LibMC) +# Use ccache if available for faster rebuilds +find_program(CCACHE_PROGRAM ccache) +if(CCACHE_PROGRAM) + set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") + set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") + message(STATUS "Using ccache: ${CCACHE_PROGRAM}") +endif() + option(INCLUDE_DRIVERS "Include the drivers in the build" ON) option(INCLUDE_TESTS "Include the test system in the build" OFF) option(ENABLE_COVERAGE "Enable coverage instrumentation (GCC/Clang)" OFF)