File tree Expand file tree Collapse file tree 2 files changed +28
-0
lines changed
Expand file tree Collapse file tree 2 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -157,4 +157,24 @@ foreach (System.Diagnostics.Process p in System.Diagnostics.Process.GetProcesses
157157 <Error Text =" Unable to locate signtool.exe. Set /p:SignToolPath and rebuild" Condition =" '$(_SignCommand)' == ''" />
158158 <Exec Command =' $(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)" || $(_SignCommand) "$(TargetPath)"' ContinueOnError =" false" />
159159 </Target >
160+
161+ <Target Name =" FindVCRuntime" Returns =" VCRuntimeDLL" >
162+ <PropertyGroup Condition =" $(PlatformToolset) != 'v140'" >
163+ <VCRedistDir >$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\</VCRedistDir >
164+ <VCRedistDir Condition =" $(Platform) == 'Win32'" >$(VCRedistDir)x86\</VCRedistDir >
165+ <VCRedistDir Condition =" $(Platform) != 'Win32'" >$(VCRedistDir)$(Platform)\</VCRedistDir >
166+ </PropertyGroup >
167+ <PropertyGroup Condition =" $(PlatformToolset) == 'v140'" >
168+ <VCRedistDir >$(VCInstallDir)\redist\</VCRedistDir >
169+ <VCRedistDir Condition =" $(Platform) == 'Win32'" >$(VCRedistDir)x86\</VCRedistDir >
170+ <VCRedistDir Condition =" $(Platform) != 'Win32'" >$(VCRedistDir)$(Platform)\</VCRedistDir >
171+ </PropertyGroup >
172+
173+ <ItemGroup Condition =" $(VCInstallDir) != ''" >
174+ <VCRuntimeDLL Include =" $(VCRedistDir)\Microsoft.VC*.CRT\vcruntime*.dll" />
175+ </ItemGroup >
176+
177+ <Error Text =" vcruntime14*.dll not found under $(VCInstallDir)" Condition =" @(VCRuntimeDLL) == ''" />
178+ <Message Text =" VCRuntimeDLL: @(VCRuntimeDLL)" Importance =" high" />
179+ </Target >
160180</Project >
Original file line number Diff line number Diff line change 406406 <Target Name =" _WarnAboutToolset" BeforeTargets =" PrepareForBuild" Condition =" $(PlatformToolset) != 'v90'" >
407407 <Warning Text =" Toolset $(PlatformToolset) is not used for official builds. Your build may have errors or incompatibilities." />
408408 </Target >
409+ <Target Name =" _CopyVCRuntime" AfterTargets =" Build" Inputs =" @(VCRuntimeDLL)" Outputs =" $(OutDir)%(Filename)%(Extension)" DependsOnTargets =" FindVCRuntime" >
410+ <!-- bpo-38597: When we switch to another VCRuntime DLL, include vcruntime140.dll as well -->
411+ <Warning Text =" A copy of vcruntime140.dll is also required" Condition =" !$(VCToolsRedistVersion.StartsWith(`14.`))" />
412+ <Copy SourceFiles =" %(VCRuntimeDLL.FullPath)" DestinationFolder =" $(OutDir)" />
413+ </Target >
414+ <Target Name =" _CleanVCRuntime" AfterTargets =" Clean" >
415+ <Delete Files =" @(VCRuntimeDLL->'$(OutDir)%(Filename)%(Extension)')" />
416+ </Target >
409417</Project >
You can’t perform that action at this time.
0 commit comments