setup_ccache 790 B

123456789101112131415161718192021222324252627282930313233
  1. autoload -Uz log_debug log_warning
  2. if (( ${+commands[ccache]} )) {
  3. log_debug "Found ccache at ${commands[ccache]}"
  4. ccache --set-config=run_second_cpp=true
  5. ccache --set-config=direct_mode=true
  6. ccache --set-config=inode_cache=true
  7. ccache --set-config=compiler_check=content
  8. ccache --set-config=file_clone=true
  9. local -a sloppiness=(
  10. include_file_mtime
  11. include_file_ctime
  12. file_stat_matches
  13. system_headers
  14. )
  15. if [[ ${host_os} == macos ]] {
  16. sloppiness+=(
  17. modules
  18. clang_index_store
  19. )
  20. ccache --set-config=sloppiness=${(j:,:)sloppiness}
  21. }
  22. ccache --set-config=cache_dir="${GITHUB_WORKSPACE:-${HOME}}/.ccache"
  23. ccache --set-config=max_size="${CCACHE_SIZE:-1G}"
  24. ccache -z > /dev/null
  25. } else {
  26. log_warning "Ccache not available"
  27. }