]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-45816: Support building with VS 2022 (v143 toolset) on Windows (GH-29577)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 23 Jun 2022 19:50:36 +0000 (12:50 -0700)
committerGitHub <noreply@github.com>
Thu, 23 Jun 2022 19:50:36 +0000 (12:50 -0700)
(cherry picked from commit d9301703fb1086cafbd730c17e3d450a192485d6)

Co-authored-by: Crowthebird <78076854+thatbirdguythatuknownot@users.noreply.github.com>
Misc/NEWS.d/next/Build/2021-11-16-14-44-06.bpo-45816.nbdmVK.rst [new file with mode: 0644]
PCbuild/pyproject.props
PCbuild/python.props
PCbuild/pythoncore.vcxproj
Tools/msi/bundle/bootstrap/pythonba.vcxproj

diff --git a/Misc/NEWS.d/next/Build/2021-11-16-14-44-06.bpo-45816.nbdmVK.rst b/Misc/NEWS.d/next/Build/2021-11-16-14-44-06.bpo-45816.nbdmVK.rst
new file mode 100644 (file)
index 0000000..4a14c90
--- /dev/null
@@ -0,0 +1 @@
+Python now supports building with Visual Studio 2022 (MSVC v143, VS Version 17.0). Patch by Jeremiah Vivian.
\ No newline at end of file
index 5af68b27d4c10f17f34db2f5172c283ea07c62d8..f3068978fcbc57fab755231379f34e87b44f0f9f 100644 (file)
@@ -75,7 +75,7 @@
       <LinkTimeCodeGeneration Condition="$(SupportPGO) and $(Configuration) == 'PGInstrument'">PGInstrument</LinkTimeCodeGeneration>
       <LinkTimeCodeGeneration Condition="$(SupportPGO) and $(Configuration) == 'PGUpdate'">PGUpdate</LinkTimeCodeGeneration>
       <AdditionalDependencies>advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;%(AdditionalDependencies)</AdditionalDependencies>
-      <AdditionalOptions Condition="$(Configuration) != 'Debug'">/OPT:REF,NOICF %(AdditionalOptions)</AdditionalOptions>
+      <AdditionalOptions Condition="$(Configuration) != 'Debug'">/OPT:REF,NOICF /CGTHREADS:1 /PDBTHREADS:1 %(AdditionalOptions)</AdditionalOptions>
     </Link>
     <Lib>
       <LinkTimeCodeGeneration Condition="$(Configuration) == 'Release'">true</LinkTimeCodeGeneration>
index c451429da2c827bf7e77738ff2daf80493462d61..859f9db2a8fc15e1c85efa4a0633dd476b32d137 100644 (file)
@@ -11,7 +11,7 @@
 
     We set BasePlatformToolset for ICC's benefit, it's otherwise ignored.
     -->
-    <BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and '$(VisualStudioVersion)' == '17.0'">v142</BasePlatformToolset>
+    <BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and '$(VisualStudioVersion)' == '17.0'">v143</BasePlatformToolset>
     <BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and '$(VisualStudioVersion)' == '16.0'">v142</BasePlatformToolset>
     <BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and ('$(MSBuildToolsVersion)' == '15.0' or '$(VisualStudioVersion)' == '15.0')">v141</BasePlatformToolset>
     <BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and '$(VCTargetsPath14)' != ''">v140</BasePlatformToolset>
index 3ba63587642d1a2e05a695734fbcb5cc8aa5dced..fe8b2c90ed041b64a21c9b11afafc65396ef537e 100644 (file)
       </ClCompile>
     </ItemGroup>
   </Target>
-  <Target Name="_WarnAboutToolset" BeforeTargets="PrepareForBuild" Condition="$(PlatformToolset) != 'v140' and $(PlatformToolset) != 'v141' and $(PlatformToolset) != 'v142'">
+  <Target Name="_WarnAboutToolset" BeforeTargets="PrepareForBuild" Condition="$(PlatformToolset) != 'v140' and $(PlatformToolset) != 'v141' and $(PlatformToolset) != 'v142' and $(PlatformToolset) != 'v143'">
     <Warning Text="Toolset $(PlatformToolset) is not used for official builds. Your build may have errors or incompatibilities." />
   </Target>
   <Target Name="_WarnAboutZlib" BeforeTargets="PrepareForBuild" Condition="!$(IncludeExternals)">
index ef71fe7da08d32b550d832005cef79d69dff5b0d..d90b5e3ff00096a5ed5510b99fdd68e12e174067 100644 (file)
@@ -73,4 +73,4 @@
     <None Include="pythonba.def" />
   </ItemGroup>
   <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-</Project>
\ No newline at end of file
+</Project>