diff --git a/tools/chatgui/build.sh b/tools/chatgui/build.sh index 1c2847dc..6bf036e1 100755 --- a/tools/chatgui/build.sh +++ b/tools/chatgui/build.sh @@ -18,7 +18,15 @@ log "Source: $SRC_DIR" log "Build: $BUILD_DIR" log "" -log "[1/4] Configuring CMake..." +if [ -f "$BUILD_DIR/CMakeCache.txt" ]; then + OLD_GEN=$(grep 'CMAKE_GENERATOR:' "$BUILD_DIR/CMakeCache.txt" 2>/dev/null | cut -d= -f2) + if [ "$OLD_GEN" != "Ninja" ]; then + log "Generator changed ($OLD_GEN -> Ninja), cleaning build dir..." + rm -rf "$BUILD_DIR" + fi +fi + +log "[1/4] Configuring CMake (generator: Ninja)..." cmake -S "$SRC_DIR" -B "$BUILD_DIR" -G Ninja 2>&1 | tee -a "$LOG_FILE" test ${PIPESTATUS[0]} -eq 0 || { log "CMake configure FAILED"; exit 1; }