Files
obs-studio/.github/scripts/utils.zsh/setup_ccache
PatTheMav 02f596b4e8 ci: Limit use of Ccache option to enforce second preprocessor call
Feature was removed in Ccache 4.12, which is provided by Homebrew by
default since 2025-10-19.
2025-09-19 14:26:29 -04:00

38 lines
929 B
Plaintext

autoload -Uz is-at-least log_debug log_warning
if (( ${+commands[ccache]} )) {
log_debug "Found ccache at ${commands[ccache]}"
local ccache_version=$(ccache --version | head -1 | cut -d ' ' -f 3)
if ! is-at-least 4.12 ${ccache_version}; then
ccache --set-config=run_second_cpp=true
fi
ccache --set-config=direct_mode=true
ccache --set-config=inode_cache=true
ccache --set-config=compiler_check=content
ccache --set-config=file_clone=true
local -a sloppiness=(
include_file_mtime
include_file_ctime
file_stat_matches
system_headers
)
if [[ ${host_os} == macos ]] {
sloppiness+=(
modules
clang_index_store
)
ccache --set-config=sloppiness=${(j:,:)sloppiness}
}
ccache --set-config=cache_dir="${GITHUB_WORKSPACE:-${HOME}}/.ccache"
ccache --set-config=max_size="${CCACHE_SIZE:-1G}"
ccache -z > /dev/null
} else {
log_warning "Ccache not available"
}