[Python-checkins] bpo-45931: Prevent Directory.Build.props/targets from leaking from directories above the repo when building on Windows (GH-29854)

miss-islington webhook-mailer at python.org
Mon Nov 29 18:08:57 EST 2021


https://github.com/python/cpython/commit/b91805ec0283f0642aa3311ec617c8596f65b7b4
commit: b91805ec0283f0642aa3311ec617c8596f65b7b4
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-11-29T15:08:53-08:00
summary:

bpo-45931: Prevent Directory.Build.props/targets from leaking from directories above the repo when building on Windows (GH-29854)

(cherry picked from commit 734ed3538314c9651ae64d5e2e0e98aae3aec17b)

Co-authored-by: David Federman <david.federman at outlook.com>

files:
A PCbuild/Directory.Build.props
A PCbuild/Directory.Build.targets
M PCbuild/python.props

diff --git a/PCbuild/Directory.Build.props b/PCbuild/Directory.Build.props
new file mode 100644
index 0000000000000..3d2fe55078450
--- /dev/null
+++ b/PCbuild/Directory.Build.props
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <!-- This is intentionally left blank but exists to avoid being imported from some directory above -->
+</Project>
diff --git a/PCbuild/Directory.Build.targets b/PCbuild/Directory.Build.targets
new file mode 100644
index 0000000000000..3d2fe55078450
--- /dev/null
+++ b/PCbuild/Directory.Build.targets
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <!-- This is intentionally left blank but exists to avoid being imported from some directory above -->
+</Project>
diff --git a/PCbuild/python.props b/PCbuild/python.props
index 42c67de4afa34..2ef290cca286a 100644
--- a/PCbuild/python.props
+++ b/PCbuild/python.props
@@ -11,8 +11,8 @@
 
     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 '$(VisualStudioVersion)' == '17.0'">v142</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>
     <BasePlatformToolset Condition="'$(BasePlatformToolset)' == '' and '$(VCTargetsPath12)' != ''">v120</BasePlatformToolset>



More information about the Python-checkins mailing list