| 1 |
<?xml version="1.0" encoding="utf-8"?> |
| 2 |
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> |
| 3 |
<PropertyGroup Condition="$(Platform) == '$$PYTHON_PLATFORM$$'"> |
| 4 |
<PythonHome>$(MSBuildThisFileDirectory)\..\..\tools</PythonHome> |
| 5 |
<PythonInclude>$(PythonHome)\include</PythonInclude> |
| 6 |
<PythonLibs>$(PythonHome)\libs</PythonLibs> |
| 7 |
<PythonTag>$$PYTHON_TAG$$</PythonTag> |
| 8 |
<PythonVersion>$$PYTHON_VERSION$$</PythonVersion> |
| 9 |
|
| 10 |
<IncludePythonExe Condition="$(IncludePythonExe) == ''">true</IncludePythonExe> |
| 11 |
<IncludeVEnv Condition="$(IncludeVEnv) == ''">false</IncludeVEnv> |
| 12 |
|
| 13 |
<GetPythonRuntimeFilesDependsOn>$$PYTHON_TARGET$$;$(GetPythonRuntimeFilesDependsOn)</GetPythonRuntimeFilesDependsOn> |
| 14 |
</PropertyGroup> |
| 15 |
|
| 16 |
<ItemDefinitionGroup Condition="$(Platform) == '$$PYTHON_PLATFORM$$'"> |
| 17 |
<ClCompile> |
| 18 |
<AdditionalIncludeDirectories>$(PythonInclude);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> |
| 19 |
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> |
| 20 |
</ClCompile> |
| 21 |
<Link> |
| 22 |
<AdditionalLibraryDirectories>$(PythonLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> |
| 23 |
</Link> |
| 24 |
</ItemDefinitionGroup> |
| 25 |
|
| 26 |
<Target Name="GetPythonRuntimeFiles" Returns="@(PythonRuntime)" DependsOnTargets="$(GetPythonRuntimeFilesDependsOn)" /> |
| 27 |
|
| 28 |
<Target Name="$$PYTHON_TARGET$$" Returns="@(PythonRuntime)"> |
| 29 |
<ItemGroup> |
| 30 |
<_PythonRuntimeExe Include="$(PythonHome)\python*.dll" /> |
| 31 |
<_PythonRuntimeExe Include="$(PythonHome)\vcruntime140.dll" /> |
| 32 |
<_PythonRuntimeExe Include="$(PythonHome)\python*.exe" Condition="$(IncludePythonExe) == 'true'" /> |
| 33 |
<_PythonRuntimeExe> |
| 34 |
<Link>%(Filename)%(Extension)</Link> |
| 35 |
</_PythonRuntimeExe> |
| 36 |
<_PythonRuntimeDlls Include="$(PythonHome)\DLLs\*.pyd" /> |
| 37 |
<_PythonRuntimeDlls Include="$(PythonHome)\DLLs\*.dll" /> |
| 38 |
<_PythonRuntimeDlls> |
| 39 |
<Link>DLLs\%(Filename)%(Extension)</Link> |
| 40 |
</_PythonRuntimeDlls> |
| 41 |
<_PythonRuntimeLib Include="$(PythonHome)\Lib\**\*" Exclude="$(PythonHome)\Lib\**\*.pyc;$(PythonHome)\Lib\site-packages\**\*" /> |
| 42 |
<_PythonRuntimeLib Remove="$(PythonHome)\Lib\ensurepip\**\*" Condition="$(IncludeVEnv) != 'true'" /> |
| 43 |
<_PythonRuntimeLib Remove="$(PythonHome)\Lib\venv\**\*" Condition="$(IncludeVEnv) != 'true'" /> |
| 44 |
<_PythonRuntimeLib> |
| 45 |
<Link>Lib\%(RecursiveDir)%(Filename)%(Extension)</Link> |
| 46 |
</_PythonRuntimeLib> |
| 47 |
<PythonRuntime Include="@(_PythonRuntimeExe);@(_PythonRuntimeDlls);@(_PythonRuntimeLib)" /> |
| 48 |
</ItemGroup> |
| 49 |
|
| 50 |
<Message Importance="low" Text="Collected Python runtime from $(PythonHome):%0D%0A@(PythonRuntime->' %(Link)','%0D%0A')" /> |
| 51 |
</Target> |
| 52 |
</Project> |