mirror of https://github.com/microsoft/vcpkg.git
Fix IncrementalClean deleting vcpkg-deployed DLLs on incremental builds (#50521)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
5111afdf55
commit
c3867e714d
|
|
@ -256,4 +256,27 @@
|
|||
<ReferenceCopyLocalPaths Include="@(VcpkgAppLocalDLLs)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<!--
|
||||
When the link step is skipped (incremental build, exe up-to-date),
|
||||
AppLocalFromInstalled doesn't run, so DLLs it previously copied aren't
|
||||
registered in FileWrites. MSBuild's IncrementalClean then treats them as
|
||||
orphan outputs and deletes them. This target re-registers those DLLs so
|
||||
IncrementalClean leaves them alone.
|
||||
-->
|
||||
<Target Name="AppLocalFromInstalledPreserve"
|
||||
AfterTargets="CopyFilesToOutputDirectory"
|
||||
BeforeTargets="_CleanGetCurrentAndPriorFileWrites"
|
||||
Condition="'$(_ZVcpkgClassicOrManifest)' == 'true'
|
||||
and '$(VcpkgApplocalDeps)' == 'true'
|
||||
and '$(LinkSkippedExecution)' == 'true'
|
||||
and '@(Link)' != ''">
|
||||
<ReadLinesFromFile File="$(IntDir)vcpkg.applocal.log"
|
||||
Condition="Exists('$(IntDir)vcpkg.applocal.log')">
|
||||
<Output TaskParameter="Lines" ItemName="_ZVcpkgPreservedAppLocalDLLs" />
|
||||
</ReadLinesFromFile>
|
||||
<ItemGroup>
|
||||
<FileWrites Include="@(_ZVcpkgPreservedAppLocalDLLs -> '$(OutDir)%(Filename)%(Extension)')" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
</Project>
|
||||
|
|
|
|||
Loading…
Reference in New Issue