summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCrowthebird <78076854+thatbirdguythatuknownot@users.noreply.github.com>2021-12-03 19:47:38 (GMT)
committerGitHub <noreply@github.com>2021-12-03 19:47:38 (GMT)
commitd9301703fb1086cafbd730c17e3d450a192485d6 (patch)
tree6049aa691226c8b79ef01c8b9fc6d3f15ad24100
parent2ff758bd1a144ee712e96ae1db91f476c3b252bb (diff)
downloadcpython-d9301703fb1086cafbd730c17e3d450a192485d6.zip
cpython-d9301703fb1086cafbd730c17e3d450a192485d6.tar.gz
cpython-d9301703fb1086cafbd730c17e3d450a192485d6.tar.bz2
bpo-45816: Support building with VS 2022 (v143 toolset) on Windows (GH-29577)
-rw-r--r--Misc/NEWS.d/next/Build/2021-11-16-14-44-06.bpo-45816.nbdmVK.rst1
-rw-r--r--PCbuild/pyproject.props2
-rw-r--r--PCbuild/python.props2
-rw-r--r--PCbuild/pythoncore.vcxproj2
-rw-r--r--Tools/msi/bundle/bootstrap/pythonba.vcxproj2
5 files changed, 5 insertions, 4 deletions
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
index 0000000..4a14c90
--- /dev/null
+++ b/Misc/NEWS.d/next/Build/2021-11-16-14-44-06.bpo-45816.nbdmVK.rst
@@ -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
diff --git a/PCbuild/pyproject.props b/PCbuild/pyproject.props
index bbcabb5..0eaeb6b 100644
--- a/PCbuild/pyproject.props
+++ b/PCbuild/pyproject.props
@@ -73,7 +73,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>
diff --git a/PCbuild/python.props b/PCbuild/python.props
index c608fb9..7b85ad1 100644
--- a/PCbuild/python.props
+++ b/PCbuild/python.props
@@ -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>
diff --git a/PCbuild/pythoncore.vcxproj b/PCbuild/pythoncore.vcxproj
index b446e09..119650a 100644
--- a/PCbuild/pythoncore.vcxproj
+++ b/PCbuild/pythoncore.vcxproj
@@ -588,7 +588,7 @@
</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)">
diff --git a/Tools/msi/bundle/bootstrap/pythonba.vcxproj b/Tools/msi/bundle/bootstrap/pythonba.vcxproj
index ef71fe7..d90b5e3 100644
--- a/Tools/msi/bundle/bootstrap/pythonba.vcxproj
+++ b/Tools/msi/bundle/bootstrap/pythonba.vcxproj
@@ -73,4 +73,4 @@
<None Include="pythonba.def" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
-</Project> \ No newline at end of file
+</Project>