From 2ca7414e5cd386017eeefdf6d77ac42d21846e87 Mon Sep 17 00:00:00 2001 From: fanlusky <1730976608@qq.com> Date: Sat, 26 Sep 2026 16:00:59 +0800 Subject: [PATCH] =?UTF-8?q?fix(windows):=20lcompile-release=20=E4=BB=A5=20?= =?UTF-8?q?generate.stamp=20=E5=88=A4=E6=96=AD=E6=98=AF=E5=90=A6=E9=9C=80?= =?UTF-8?q?=E8=A6=81=E9=87=8D=E6=96=B0=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 配置失败(例如 vcpkg 安装出错)时 CMakeCache.txt 依然会留下,导致之后 直接跳过 configure、在残缺的构建目录上编译。改为检查只有项目生成成功才 会写入的 CMakeFiles/generate.stamp。 --- windows/scripts/lcompile-release.ps1 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/windows/scripts/lcompile-release.ps1 b/windows/scripts/lcompile-release.ps1 index 7e6fbc26..c8a8a2da 100644 --- a/windows/scripts/lcompile-release.ps1 +++ b/windows/scripts/lcompile-release.ps1 @@ -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)" } }