From d0fa0f9ab936d8588d62ddbae94fcdb4eb82059a Mon Sep 17 00:00:00 2001 From: tooomm Date: Tue, 21 Jul 2026 21:09:52 +0200 Subject: [PATCH] fix ccache on win --- .ci/compile.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/.ci/compile.sh b/.ci/compile.sh index a45ff338d..e028219f4 100755 --- a/.ci/compile.sh +++ b/.ci/compile.sh @@ -147,14 +147,16 @@ fi if [[ $MAKE_TEST ]]; then flags+=("-DTEST=1") fi -if [[ $USE_CCACHE ]]; then +if [[ $USE_CCACHE == "1" ]]; then flags+=("-DUSE_CCACHE=1") - if [[ $CCACHE_SIZE ]]; then + if [[ -n $CCACHE_SIZE ]]; then # note, this setting persists after running the script ccache --max-size "$CCACHE_SIZE" fi +else + flags+=("-DUSE_CCACHE=0") fi -if [[ $PACKAGE_TYPE ]]; then +if [[ -n $PACKAGE_TYPE ]]; then flags+=("-DCPACK_GENERATOR=$PACKAGE_TYPE") fi if [[ $USE_VCPKG ]]; then @@ -252,7 +254,7 @@ if [[ $RUNNER_OS == macOS ]]; then fi fi -if [[ $USE_CCACHE ]]; then +if [[ $USE_CCACHE == "1" ]]; then echo "::group::Show ccache stats" ccachestatsverbose echo "::endgroup::" @@ -290,8 +292,8 @@ echo "Running cmake --build with flags: ${buildflags[*]}" cmake --build . "${buildflags[@]}" --verbose echo "::endgroup::" -if [[ $USE_CCACHE ]]; then - if [[ $CCACHE_EVICTION_AGE ]]; then +if [[ $USE_CCACHE == "1" ]]; then + if [[ -n $CCACHE_EVICTION_AGE ]]; then echo "::group::evict ccache files older than $CCACHE_EVICTION_AGE" ccache --evict-older-than "$CCACHE_EVICTION_AGE" echo "::endgroup::" @@ -333,7 +335,7 @@ if [[ $MAKE_PACKAGE ]]; then cmake --build . --target package --config "$BUILDTYPE" echo "::endgroup::" - if [[ $PACKAGE_SUFFIX ]]; then + if [[ -n $PACKAGE_SUFFIX ]]; then echo "::group::Update package name" cd .. BUILD_DIR="$BUILD_DIR" .ci/name_build.sh "$PACKAGE_SUFFIX"