File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -76,11 +76,22 @@ set(CMAKE_CXX_COMPILER "$wrapper_dir/c++")
7676set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)
7777EOF
7878
79+ is_stale_z3_build_dir () {
80+ local build_dir=$1
81+
82+ grep -R -q -E \
83+ ' cargo-zigbuild|zigc(c|xx)-.*unknown-linux-gnu\.[0-9]+\.[0-9]+' \
84+ " $build_dir /CMakeCache.txt" " $build_dir /CMakeFiles" 2> /dev/null
85+ }
86+
7987for profile in release debug; do
8088 z3_build_root=" target/$bare_cargo_target /$profile /build"
8189 if [[ -d $z3_build_root ]]; then
82- while IFS= read -r stale_build_dir; do
83- rm -rf " $stale_build_dir "
90+ while IFS= read -r z3_build_dir; do
91+ if is_stale_z3_build_dir " $z3_build_dir " ; then
92+ echo " Removing stale z3-sys CMake cache: $z3_build_dir " >&2
93+ rm -rf " $z3_build_dir "
94+ fi
8495 done < <( find " $z3_build_root " -mindepth 3 -maxdepth 3 -type d -path " */z3-sys-*/out/build" )
8596 fi
8697done
You can’t perform that action at this time.
0 commit comments