diff options
| author | ras0219 <533828+ras0219@users.noreply.github.com> | 2021-01-29 11:04:53 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-01-29 11:04:53 -0800 |
| commit | 401b26c9866a071f645ae57831caa419b2c48be1 (patch) | |
| tree | ddc66a2788b478359a5cfc010a1993bc96bc7570 /scripts | |
| parent | 865de0c130f3d34174ac7a410789df3c44a27fd2 (diff) | |
| download | vcpkg-401b26c9866a071f645ae57831caa419b2c48be1.tar.gz vcpkg-401b26c9866a071f645ae57831caa419b2c48be1.zip | |
[vcpkg] Teach vcpkg.targets to emit a .tlog, enabling up-to-date checks (#15898)
Co-authored-by: Robert Schumacher <roschuma@microsoft.com>
Diffstat (limited to 'scripts')
| -rw-r--r-- | scripts/buildsystems/msbuild/vcpkg.targets | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/scripts/buildsystems/msbuild/vcpkg.targets b/scripts/buildsystems/msbuild/vcpkg.targets index 0ba7d8918..5f22d0fe5 100644 --- a/scripts/buildsystems/msbuild/vcpkg.targets +++ b/scripts/buildsystems/msbuild/vcpkg.targets @@ -30,6 +30,7 @@ <VcpkgConfigSubdir Condition="'$(VcpkgNormalizedConfiguration)' == 'Debug'">debug\</VcpkgConfigSubdir> <VcpkgApplocalDeps Condition="'$(VcpkgApplocalDeps)' == ''">true</VcpkgApplocalDeps> + <ProjectStateLine>VcpkgTriplet=$(VcpkgTriplet):$(ProjectStateLine)</ProjectStateLine> </PropertyGroup> <!-- Import property page 'Vcpkg' --> @@ -68,15 +69,35 @@ Importance="High" Condition="'$(VcpkgEnabled)' == 'true' and '$(VcpkgNormalizedConfiguration)' == ''"/> </Target> + <ItemGroup> + <_VcpkgInstallManifestDependenciesInputs Include="$(VcpkgManifestRoot)vcpkg.json"/> + <_VcpkgInstallManifestDependenciesInputs Include="$(VcpkgManifestRoot)vcpkg-configuration.json" Condition="Exists('$(VcpkgManifestRoot)vcpkg-configuration.json')"/> + </ItemGroup> + <Target Name="VcpkgInstallManifestDependencies" BeforeTargets="ClCompile" - Condition="'$(VcpkgEnabled)' == 'true' and '$(VcpkgEnableManifest)' == 'true' and '$(VcpkgManifestInstall)' == 'true'"> - <Message Text="Installing vcpkg dependencies" Importance="High" /> - <Exec Command="%22$([System.IO.Path]::Combine($(VcpkgRoot), 'vcpkg.exe'))%22 install --x-wait-for-lock --triplet %22$(VcpkgTriplet)%22 --vcpkg-root %22$(VcpkgRoot)\%22 %22--x-manifest-root=$(VcpkgManifestRoot)\%22 %22--x-install-root=$(VcpkgInstalledDir)\%22" + Condition="'$(VcpkgEnabled)' == 'true' and '$(VcpkgEnableManifest)' == 'true' and '$(VcpkgManifestInstall)' == 'true'" + Inputs="@(_VcpkgInstallManifestDependenciesInputs)" + Outputs="$(TLogLocation)VcpkgInstallManifest$(VcpkgTriplet).read.1u.tlog"> + <Message Text="Installing vcpkg dependencies to $(VcpkgInstalledDir)" Importance="High" /> + <MakeDir Directories="$(TLogLocation)" /> + <ItemGroup> + <_VcpkgItemToDelete Include="$(TLogLocation)VcpkgInstallManifest*.read.1u.tlog" /> + </ItemGroup> + <Delete Files="@(_VcpkgItemToDelete)" /> + <Exec Command="%22$([System.IO.Path]::Combine($(VcpkgRoot), 'vcpkg.exe'))%22 install --x-wait-for-lock --triplet %22$(VcpkgTriplet)%22 --vcpkg-root %22$(VcpkgRoot)\%22 %22--x-manifest-root=$(VcpkgManifestRoot)\%22 %22--x-install-root=$(VcpkgInstalledDir)\%22" StandardOutputImportance="High" /> + <WriteLinesToFile File="$(TLogLocation)VcpkgInstallManifest$(VcpkgTriplet).read.1u.tlog" + Lines="@(_VcpkgInstallManifestDependenciesInputs -> '^%(Identity)')" + Encoding="Unicode" + Overwrite="true"/> + + <CreateProperty Value="false"> + <Output TaskParameter="ValueSetByTask" PropertyName="Link_MinimalRebuildFromTracking" /> + </CreateProperty> </Target> <Target Name="AppLocalFromInstalled" AfterTargets="CopyFilesToOutputDirectory" BeforeTargets="CopyLocalFilesOutputGroup;RegisterOutput" - Condition="'$(VcpkgEnabled)' == 'true' and '$(VcpkgApplocalDeps)' == 'true'"> + Condition="'$(VcpkgEnabled)' == 'true' and '$(VcpkgApplocalDeps)' == 'true' and '$(LinkSkippedExecution)' != 'true'"> <Message Text="[vcpkg] Starting VcpkgApplocalDeps" Importance="low" /> <PropertyGroup> <_VcpkgAppLocalPowerShellCommonArguments>-ExecutionPolicy Bypass -noprofile -File "$(MSBuildThisFileDirectory)applocal.ps1" "$(TargetPath)" "$(VcpkgCurrentInstalledDir)$(VcpkgConfigSubdir)bin" "$(TLogLocation)$(ProjectName).write.1u.tlog" "$(IntDir)vcpkg.applocal.log"</_VcpkgAppLocalPowerShellCommonArguments> |
