[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:24:51 EDT 2021


https://github.com/python/cpython/commit/6843a3b9300eb80c2bf5dac7dd363dae9e6f000d
commit: 6843a3b9300eb80c2bf5dac7dd363dae9e6f000d
branch: 3.10
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:24:42-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 4a56d50b8b7655..60625101b47287 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