Fix IncrementalClean deleting applocal-deployed DLLs on full builds (#52360)

This commit is contained in:
Cleroth 2026-06-13 04:56:06 +08:00 committed by GitHub
parent b216ddff25
commit cc68f7fe81
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 8 additions and 0 deletions

View File

@ -269,6 +269,14 @@
<Message Text="@(VcpkgAppLocalDLLs,'%0A')" Importance="Normal" Condition="$(_ZVcpkgAppLocalExitCode) == 0" />
<ItemGroup Condition="$(_ZVcpkgAppLocalExitCode) == 0">
<ReferenceCopyLocalPaths Include="@(VcpkgAppLocalDLLs)" />
<!-- Register the deployed DLLs as file writes so MSBuild's IncrementalClean
doesn't treat them as orphan outputs and delete them. Without this, any
clean-file entries recorded by AppLocalFromInstalledPreserve on a previous
link-skipped build cause IncrementalClean to delete the DLLs on the next
build where the link runs, immediately after they were deployed. The paths
are re-based to $(OutDir) because z-applocal logs source paths while
applocal.ps1 logs destination paths. -->
<FileWrites Include="@(VcpkgAppLocalDLLs -> '$(OutDir)%(Filename)%(Extension)')" />
</ItemGroup>
</Target>