[Python-checkins] bpo-44535: Enable building with Visual Studio 2022 on Windows (GH-26962)

miss-islington webhook-mailer at python.org
Wed Jun 30 15:31:13 EDT 2021


https://github.com/python/cpython/commit/67e394562d67cbcd0ac8114e5439494e7645b8f5
commit: 67e394562d67cbcd0ac8114e5439494e7645b8f5
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2021-06-30T12:31:04-07:00
summary:

bpo-44535: Enable building with Visual Studio 2022 on Windows (GH-26962)

(cherry picked from commit d3a95c1b6eacbbbd92c294744e7ed41932f3f63e)

Co-authored-by: Steve Dower <steve.dower at python.org>

files:
A Misc/NEWS.d/next/Build/2021-06-30-02-32-46.bpo-44535.M9iN4-.rst
M PCbuild/python.props

diff --git a/Misc/NEWS.d/next/Build/2021-06-30-02-32-46.bpo-44535.M9iN4-.rst b/Misc/NEWS.d/next/Build/2021-06-30-02-32-46.bpo-44535.M9iN4-.rst
new file mode 100644
index 00000000000000..e06d0d304852f3
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2021-06-30-02-32-46.bpo-44535.M9iN4-.rst
@@ -0,0 +1 @@
+Enable building using a Visual Studio 2022 install on Windows.
diff --git a/PCbuild/python.props b/PCbuild/python.props
index 419d5ebe84c2d1..acbf4e005ec5ba 100644
--- a/PCbuild/python.props
+++ b/PCbuild/python.props
@@ -11,6 +11,7 @@
 
     We set BasePlatformToolset for ICC's benefit, it's otherwise ignored.
     -->
+    <BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and ('$(MSBuildToolsVersion)' == '17.0' or '$(VisualStudioVersion)' == '17.0')">v142</BasePlatformToolset>
     <BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and ('$(MSBuildToolsVersion)' == '16.0' or '$(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>



More information about the Python-checkins mailing list