mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-23 18:06:26 -07:00
[Build] Add PCH-aware ccache sloppiness config; format cmake/pch headers
This commit is contained in:
parent
b89981c752
commit
0d9d0e1404
4 changed files with 9 additions and 1 deletions
|
|
@ -149,6 +149,9 @@ if [[ $MAKE_TEST ]]; then
|
||||||
fi
|
fi
|
||||||
if [[ $USE_CCACHE ]]; then
|
if [[ $USE_CCACHE ]]; then
|
||||||
flags+=("-DUSE_CCACHE=1")
|
flags+=("-DUSE_CCACHE=1")
|
||||||
|
# PCH-aware caching is required or ccache refuses to cache any TU that
|
||||||
|
# consumes a precompiled header, silently recompiling everything on every run.
|
||||||
|
ccache --set-config sloppiness=pch_defines,time_macros
|
||||||
if [[ $CCACHE_SIZE ]]; then
|
if [[ $CCACHE_SIZE ]]; then
|
||||||
# note, this setting persists after running the script
|
# note, this setting persists after running the script
|
||||||
ccache --max-size "$CCACHE_SIZE"
|
ccache --max-size "$CCACHE_SIZE"
|
||||||
|
|
|
||||||
|
|
@ -44,6 +44,10 @@ if(USE_CCACHE)
|
||||||
if(CCACHE_PROGRAM)
|
if(CCACHE_PROGRAM)
|
||||||
# Support Unix Makefiles and Ninja
|
# Support Unix Makefiles and Ninja
|
||||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
|
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}")
|
message(STATUS "Found CCache ${CCACHE_PROGRAM}")
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ include=("cockatrice/src" \
|
||||||
libcockatrice_* \
|
libcockatrice_* \
|
||||||
"oracle/src" \
|
"oracle/src" \
|
||||||
"servatrice/src" \
|
"servatrice/src" \
|
||||||
|
"cmake/pch" \
|
||||||
"tests")
|
"tests")
|
||||||
exclude=("libcockatrice_rng/libcockatrice/rng/sfmt/" \
|
exclude=("libcockatrice_rng/libcockatrice/rng/sfmt/" \
|
||||||
"libcockatrice_utility/libcockatrice/utility/peglib.h" \
|
"libcockatrice_utility/libcockatrice/utility/peglib.h" \
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue