Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion PCbuild/build.bat
Original file line number Diff line number Diff line change
Expand Up @@ -148,4 +148,5 @@ goto :eof

:Version
rem Display the current build version information
%MSBUILD% "%dir%python.props" /t:ShowVersionInfo /v:m /nologo %1 %2 %3 %4 %5 %6 %7 %8 %9
call "%dir%find_msbuild.bat" %MSBUILD%
if not ERRORLEVEL 1 %MSBUILD% "%dir%pythoncore.vcxproj" /t:ShowVersionInfo /v:m /nologo %1 %2 %3 %4 %5 %6 %7 %8 %9
17 changes: 11 additions & 6 deletions PCbuild/python.props
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,18 @@
-->
<_RegistryVersion>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion)</_RegistryVersion>
<_RegistryVersion Condition="$(_RegistryVersion) == ''">$(Registry:HKEY_LOCAL_MACHINE\WOW6432Node\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v10.0@ProductVersion)</_RegistryVersion>
<DefaultWindowsSDKVersion>10.0.17134.0</DefaultWindowsSDKVersion>
<DefaultWindowsSDKVersion Condition="$(_RegistryVersion) == '10.0.16299'">10.0.16299.0</DefaultWindowsSDKVersion>
<DefaultWindowsSDKVersion Condition="$(_RegistryVersion) == '10.0.15063'">10.0.15063.0</DefaultWindowsSDKVersion>
<DefaultWindowsSDKVersion Condition="$(_RegistryVersion) == '10.0.14393'">10.0.14393.0</DefaultWindowsSDKVersion>
<DefaultWindowsSDKVersion Condition="$(_RegistryVersion) == '10.0.10586'">10.0.10586.0</DefaultWindowsSDKVersion>
<DefaultWindowsSDKVersion Condition="$(_RegistryVersion) == '10.0.10240'">10.0.10240.0</DefaultWindowsSDKVersion>
<!-- Sometimes the version in the registry has to .0 suffix, and sometimes it doesn't. Check and add it -->
<_RegistryVersion Condition="$(_RegistryVersion) != '' and !$(_RegistryVersion.EndsWith('.0'))">$(_RegistryVersion).0</_RegistryVersion>

<!-- The minimum allowed SDK version to use for building -->
<DefaultWindowsSDKVersion>10.0.10586.0</DefaultWindowsSDKVersion>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I chose this SDK version as the minimum as I remember an issue ~5 years ago that was solved by using this version instead of an earlier one (although possibly pre-release).

<DefaultWindowsSDKVersion Condition="$([System.Version]::Parse($(_RegistryVersion))) > $([System.Version]::Parse($(DefaultWindowsSDKVersion)))">$(_RegistryVersion)</DefaultWindowsSDKVersion>
</PropertyGroup>

<PropertyGroup Condition="$(WindowsTargetPlatformVersion) == ''">
<WindowsTargetPlatformVersion>$(DefaultWindowsSDKVersion)</WindowsTargetPlatformVersion>
</PropertyGroup>

<PropertyGroup Condition="'$(OverrideVersion)' == ''">
<!--
Read version information from Include\patchlevel.h. The following properties are set:
Expand Down Expand Up @@ -190,5 +194,6 @@
<Message Importance="high" Text="Field3Value: $(Field3Value)" />
<Message Importance="high" Text="SysWinVer: $(SysWinVer)" />
<Message Importance="high" Text="PyDllName: $(PyDllName)" />
<Message Importance="high" Text="WindowsSdkVersion: $(TargetPlatformVersion)" />
</Target>
</Project>