[Build] Add PCH-aware ccache sloppiness config; format cmake/pch headers

This commit is contained in:
Lukas Brübach 2026-09-02 15:09:53 +02:00 • committed by GitHub
parent b89981c752
commit 0d9d0e1404
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 1 deletions

View file

@ -44,6 +44,10 @@ if(USE_CCACHE)
if(CCACHE_PROGRAM)
# Support Unix Makefiles and Ninja
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
# PCH-aware caching, matching .ci/compile.sh: without this ccache refuses
# to cache any TU that consumes a precompiled header, so every PCH-backed
# target recompiles from scratch on each build.
execute_process(COMMAND ${CCACHE_PROGRAM} --set-config sloppiness=pch_defines,time_macros)
message(STATUS "Found CCache ${CCACHE_PROGRAM}")
endif()
endif()