]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-40158: Fix CPython MSBuild Properties in NuGet Package (GH-19343)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 3 Apr 2020 22:20:12 +0000 (15:20 -0700)
committerGitHub <noreply@github.com>
Fri, 3 Apr 2020 22:20:12 +0000 (23:20 +0100)
Fix default Python home path relative to the NuGet package
(cherry picked from commit 6e623ff9d251e0ce86e9b18a01bfd6f067079d7a)

Co-authored-by: Chris Martinez <sydefekt@hotmail.com>
Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst [new file with mode: 0644]
PC/layout/support/props.py

diff --git a/Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst b/Misc/NEWS.d/next/Build/2020-04-03-17-54-33.bpo-40158.MWUTs4.rst
new file mode 100644 (file)
index 0000000..a81548c
--- /dev/null
@@ -0,0 +1 @@
+Fix CPython MSBuild Properties in NuGet Package (build/native/python.props)
\ No newline at end of file
index b1560b5244762f209122e5dfcd5653fa6f9d1fc1..1eb9b7c06da513ff61cd61dca272e07b6225d1d8 100644 (file)
@@ -29,8 +29,7 @@ PROPS_DATA["PYTHON_TARGET"] = "_GetPythonRuntimeFilesDependsOn{}{}_{}".format(
 PROPS_TEMPLATE = r"""<?xml version="1.0" encoding="utf-8"?>
 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <PropertyGroup Condition="$(Platform) == '{PYTHON_PLATFORM}'">
-    <PythonHome Condition="$(Configuration) == 'Debug'">$([msbuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), "python_d.exe")</PythonHome>
-    <PythonHome Condition="$(PythonHome) == ''">$([msbuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), "python.exe")</PythonHome>
+    <PythonHome Condition="$(PythonHome) == ''">$([System.IO.Path]::GetFullPath("$(MSBuildThisFileDirectory)\..\..\tools"))</PythonHome>
     <PythonInclude>$(PythonHome)\include</PythonInclude>
     <PythonLibs>$(PythonHome)\libs</PythonLibs>
     <PythonTag>{PYTHON_TAG}</PythonTag>