diff options
Diffstat (limited to 'PCbuild/pyproject.props')
-rw-r--r-- | PCbuild/pyproject.props | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props index 061c225..bb918b2 100644 --- a/PCbuild/pyproject.props +++ b/PCbuild/pyproject.props @@ -201,23 +201,41 @@ public override bool Execute() { </Target> - <Target Name="FindVCRuntime" Returns="VCRuntimeDLL"> - <PropertyGroup Condition="$(PlatformToolset) != 'v140'"> - <VCRedistDir>$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\</VCRedistDir> - <VCRedistDir Condition="$(Platform) == 'Win32'">$(VCRedistDir)x86\</VCRedistDir> - <VCRedistDir Condition="$(Platform) != 'Win32'">$(VCRedistDir)$(Platform)\</VCRedistDir> - </PropertyGroup> + <Target Name="FindVCRedistDir"> + <!-- Hard coded path for VS 2015 --> <PropertyGroup Condition="$(PlatformToolset) == 'v140'"> <VCRedistDir>$(VCInstallDir)\redist\</VCRedistDir> + </PropertyGroup> + + <!-- Search for version number in some broken Build Tools installs --> + <ItemGroup Condition="$(VCRedistDir) == '' and $(VCToolsRedistVersion) == ''"> + <_RedistFiles Include="$(VCInstallDir)\Redist\MSVC\*\*.*" /> + </ItemGroup> + <PropertyGroup Condition="$(VCRedistDir) == '' and $(VCToolsRedistVersion) == ''"> + <_RedistDir>%(_RedistFiles.Directory)</_RedistDir> + <VCToolsRedistVersion>$([System.IO.Path]::GetFileName($(_RedistDir.Trim(`\`))))</VCToolsRedistVersion> + </PropertyGroup> + + <!-- Use correct path for VS 2017 and later --> + <PropertyGroup Condition="$(VCRedistDir) == ''"> + <VCRedistDir>$(VCInstallDir)\Redist\MSVC\$(VCToolsRedistVersion)\</VCRedistDir> + </PropertyGroup> + + <PropertyGroup> <VCRedistDir Condition="$(Platform) == 'Win32'">$(VCRedistDir)x86\</VCRedistDir> <VCRedistDir Condition="$(Platform) != 'Win32'">$(VCRedistDir)$(Platform)\</VCRedistDir> </PropertyGroup> + <Message Text="VC Redist Directory: $(VCRedistDir)" /> + <Message Text="VC Redist Version: $(VCToolsRedistVersion)" /> + </Target> + + <Target Name="FindVCRuntime" Returns="VCRuntimeDLL" DependsOnTargets="FindVCRedistDir"> <ItemGroup Condition="$(VCInstallDir) != ''"> <VCRuntimeDLL Include="$(VCRedistDir)\Microsoft.VC*.CRT\vcruntime*.dll" /> </ItemGroup> - <Warning Text="vcruntime14*.dll not found under $(VCInstallDir)" Condition="@(VCRuntimeDLL) == ''" /> - <Message Text="VCRuntimeDLL: @(VCRuntimeDLL)" Importance="high" /> + <Warning Text="vcruntime*.dll not found under $(VCRedistDir)." Condition="@(VCRuntimeDLL) == ''" /> + <Message Text="VC Runtime DLL(s):%0A- @(VCRuntimeDLL,'%0A- ')" /> </Target> </Project> |