fix(ci): ui-golden 需要机器级 SDL2 SDK——补 DTU_SDL2_DIR、配置期护栏与 build 缓存自愈
CI / L0 静态门禁 (pre-commit) (push) Failing after 7m4s
CI / L0.5 主机侧单测 (MSVC) (push) Successful in 3m6s

This commit is contained in:
2026-10-27 17:32:35 +08:00
parent ae80bb8e34
commit dc5d6a0680
7 changed files with 147 additions and 9 deletions
+10
View File
@@ -117,6 +117,16 @@ if (Test-Path $cache) {
}
}
# 半截缓存检查:上一次配置如果在 CMakeLists 里 FATAL_ERROR 中断(例如缺 SDL2 SDK),
# CMakeCache.txt 已经写下、工程文件却根本没生成,于是下面「有缓存就不配置」会跳过配置,
# 失败点跑到离根因很远的 MSBuild(MSB1009: 项目文件不存在)——2026-10-27 在 CI 等价工作区
# 实测:设好 DTU_SDL2_DIR 之后仍然红,红因就是这个残留缓存。与上面的生成器不符同理,
# 删掉 build/ 重来,让报错回到配置期那一行。
if ((Test-Path $cache) -and -not (Test-Path (Join-Path $buildDir 'ALL_BUILD.vcxproj'))) {
Write-Host '[build_sim] build/ 有缓存但没有工程文件(上次配置中断)-> 删除重建' -ForegroundColor Yellow
if (-not (Remove-BuildDir $buildDir)) { exit 3 }
}
# --- 4. 配置 + 构建 ---------------------------------------------------------
if (-not (Test-Path (Join-Path $buildDir 'CMakeCache.txt'))) {
Write-Host '[build_sim] CMake 配置 ...'