Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f04cc5f

Browse files
jklothzooba
authored andcommitted
[3.6] bpo-35433: Properly detect installed SDK versions (GH-11009)
1 parent 3acf30d commit f04cc5f

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

PCbuild/build.bat

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,4 +141,5 @@ goto :eof
141141

142142
:Version
143143
rem Display the current build version information
144-
%MSBUILD% "%dir%python.props" /t:ShowVersionInfo /v:m /nologo %1 %2 %3 %4 %5 %6 %7 %8 %9
144+
call "%dir%find_msbuild.bat" %MSBUILD%
145+
if not ERRORLEVEL 1 %MSBUILD% "%dir%pythoncore.vcxproj" /t:ShowVersionInfo /v:m /nologo %1 %2 %3 %4 %5 %6 %7 %8 %9

PCbuild/python.props

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,17 @@
7474
possible version). Since we limit WINVER to Windows 7 anyway, it doesn't really
7575
matter which WinSDK version we use.
7676
-->
77-
<_RegistryVersion>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion)</_RegistryVersion>
78-
<_RegistryVersion Condition="$(_RegistryVersion) == ''">$(Registry:HKEY_LOCAL_MACHINE\WOW6432Node\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion)</_RegistryVersion>
79-
<DefaultWindowsSDKVersion>10.0.15063.0</DefaultWindowsSDKVersion>
80-
<DefaultWindowsSDKVersion Condition="$(_RegistryVersion) == '10.0.14393'">10.0.14393.0</DefaultWindowsSDKVersion>
81-
<DefaultWindowsSDKVersion Condition="$(_RegistryVersion) == '10.0.10586'">10.0.10586.0</DefaultWindowsSDKVersion>
82-
<DefaultWindowsSDKVersion Condition="$(_RegistryVersion) == '10.0.10240'">10.0.10240.0</DefaultWindowsSDKVersion>
77+
<_KitsRoot>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0@InstallationFolder)</_KitsRoot>
78+
<_KitsRoot Condition="$(_KitsRoot) == ''">$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v10.0@InstallationFolder)</_KitsRoot>
79+
80+
<!-- The minimum allowed SDK version to use for building -->
81+
<DefaultWindowsSDKVersion>10.0.10586.0</DefaultWindowsSDKVersion>
82+
<DefaultWindowsSDKVersion Condition="Exists('$(_KitsRoot)\Platforms\UAP\10.0.14393.0')">10.0.14393.0</DefaultWindowsSDKVersion>
83+
<DefaultWindowsSDKVersion Condition="Exists('$(_KitsRoot)\Platforms\UAP\10.0.15063.0')">10.0.15063.0</DefaultWindowsSDKVersion>
84+
</PropertyGroup>
85+
86+
<PropertyGroup Condition="$(WindowsTargetPlatformVersion) == ''">
87+
<WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
8388
</PropertyGroup>
8489

8590
<PropertyGroup Condition="'$(OverrideVersion)' == ''">
@@ -187,5 +192,6 @@
187192
<Message Importance="high" Text="Field3Value: $(Field3Value)" />
188193
<Message Importance="high" Text="SysWinVer: $(SysWinVer)" />
189194
<Message Importance="high" Text="PyDllName: $(PyDllName)" />
195+
<Message Importance="high" Text="WindowsSdkVersion: $(TargetPlatformVersion)" />
190196
</Target>
191197
</Project>

0 commit comments

Comments
 (0)