ccache.cmake 672 B

1234567891011121314151617181920
  1. # OBS CMake ccache module
  2. if(NOT DEFINED CCACHE_PROGRAM)
  3. message(DEBUG "Trying to find ccache on build host...")
  4. find_program(CCACHE_PROGRAM "ccache")
  5. mark_as_advanced(CCACHE_PROGRAM)
  6. endif()
  7. if(CCACHE_PROGRAM)
  8. message(DEBUG "CCache found as ${CCACHE_PROGRAM}...")
  9. option(ENABLE_CCACHE "Enable compiler acceleration with ccache" ON)
  10. if(ENABLE_CCACHE)
  11. set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
  12. set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
  13. set(CMAKE_OBJC_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
  14. set(CMAKE_OBJCXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
  15. set(CMAKE_CUDA_COMPILER_LAUNCHER "${CCACHE_PROGRAM}")
  16. endif()
  17. endif()