[Build] Keep risky ccache sloppiness out of the global config

USE_CCACHE defaults to ON, so CMakeLists.txt runs on a developer
machine, and ccache --set-config writes the user's global ccache.conf.
The include_file_mtime/include_file_ctime entries turn off the
modified-during-compile check for every project on the machine, not
only this one, so they belong in CI (compile.sh) and not here. The two
entries PCH caching needs stay.
This commit is contained in:
Lukas Brübach 2026-11-04 09:14:34 +01:00
parent ce0746d77f
commit 301a372bdf

View file

@ -65,6 +65,10 @@ if(USE_CCACHE AND NOT WIN32)
# PCH-aware caching, matching .ci/compile.sh: without this ccache refuses # PCH-aware caching, matching .ci/compile.sh: without this ccache refuses
# to cache any TU that consumes a precompiled header, so every PCH-backed # to cache any TU that consumes a precompiled header, so every PCH-backed
# target recompiles from scratch on each build. # target recompiles from scratch on each build.
# The include_file_mtime/include_file_ctime entries that CI also sets are
# deliberately not set here: --set-config writes the user's global
# ccache.conf, and those two would turn off the modified-during-compile
# check for every project on the machine, not just this one.
execute_process(COMMAND ${CCACHE_PROGRAM} --set-config sloppiness=pch_defines,time_macros) execute_process(COMMAND ${CCACHE_PROGRAM} --set-config sloppiness=pch_defines,time_macros)
message(STATUS "Found CCache ${CCACHE_PROGRAM}") message(STATUS "Found CCache ${CCACHE_PROGRAM}")
endif() endif()