fix(windows): lcompile-release 以 generate.stamp 判断是否需要重新配置

配置失败(例如 vcpkg 安装出错)时 CMakeCache.txt 依然会留下,导致之后
直接跳过 configure、在残缺的构建目录上编译。改为检查只有项目生成成功才
会写入的 CMakeFiles/generate.stamp。
This commit is contained in:
fanlusky committed 2026-09-26 16:00:59 +08:00
1 parent b4d60c7872
commit 2ca7414e5c
1 file changed
+3 -1
+3 -1
View File
@@ -16,7 +16,9 @@ $projectRoot = Split-Path -Parent $PSScriptRoot
$buildDirectory = Join-Path $projectRoot "build$Architecture-release"
Push-Location $projectRoot
try {
if ($Reconfigure -or -not (Test-Path -LiteralPath (Join-Path $buildDirectory 'CMakeCache.txt'))) {
# A failed configure (e.g. vcpkg install error) still leaves CMakeCache.txt behind, so key off
# generate.stamp, which is only written once project generation succeeds.
if ($Reconfigure -or -not (Test-Path -LiteralPath (Join-Path $buildDirectory 'CMakeFiles\generate.stamp'))) {
cmake "--preset=for$Architecture-release"
if ($LASTEXITCODE -ne 0) { throw "TSF $Architecture configure failed ($LASTEXITCODE)" }
}