bpo-40158: Fix CPython MSBuild Properties in NuGet Package (GH-19343)

Fix default Python home path relative to the NuGet package
(cherry picked from commit 6e623ff9d2)

Co-authored-by: Chris Martinez <sydefekt@hotmail.com>
This commit is contained in:
Miss Islington (bot) 2020-04-03 15:20:12 -07:00 committed by GitHub
parent e6783981df
commit e6685ad053
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -0,0 +1 @@
Fix CPython MSBuild Properties in NuGet Package (build/native/python.props)

View File

@ -29,8 +29,7 @@ PROPS_DATA["PYTHON_TARGET"] = "_GetPythonRuntimeFilesDependsOn{}{}_{}".format(
PROPS_TEMPLATE = r"""<?xml version="1.0" encoding="utf-8"?> PROPS_TEMPLATE = r"""<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="$(Platform) == '{PYTHON_PLATFORM}'"> <PropertyGroup Condition="$(Platform) == '{PYTHON_PLATFORM}'">
<PythonHome Condition="$(Configuration) == 'Debug'">$([msbuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), "python_d.exe")</PythonHome> <PythonHome Condition="$(PythonHome) == ''">$([System.IO.Path]::GetFullPath("$(MSBuildThisFileDirectory)\..\..\tools"))</PythonHome>
<PythonHome Condition="$(PythonHome) == ''">$([msbuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), "python.exe")</PythonHome>
<PythonInclude>$(PythonHome)\include</PythonInclude> <PythonInclude>$(PythonHome)\include</PythonInclude>
<PythonLibs>$(PythonHome)\libs</PythonLibs> <PythonLibs>$(PythonHome)\libs</PythonLibs>
<PythonTag>{PYTHON_TAG}</PythonTag> <PythonTag>{PYTHON_TAG}</PythonTag>