You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
3.0 KiB

  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. <IncludePythonExe Condition="$(IncludePythonExe) == ''">true</IncludePythonExe>
  10. <IncludeDistutils Condition="$(IncludeDistutils) == ''">false</IncludeDistutils>
  11. <IncludeLib2To3 Condition="$(IncludeLib2To3) == ''">false</IncludeLib2To3>
  12. <IncludeVEnv Condition="$(IncludeVEnv) == ''">false</IncludeVEnv>
  13. <GetPythonRuntimeFilesDependsOn>$$PYTHON_TARGET$$;$(GetPythonRuntimeFilesDependsOn)</GetPythonRuntimeFilesDependsOn>
  14. </PropertyGroup>
  15. <ItemDefinitionGroup Condition="$(Platform) == '$$PYTHON_PLATFORM$$'">
  16. <ClCompile>
  17. <AdditionalIncludeDirectories>$(PythonInclude);%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
  18. <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
  19. </ClCompile>
  20. <Link>
  21. <AdditionalLibraryDirectories>$(PythonLibs);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
  22. </Link>
  23. </ItemDefinitionGroup>
  24. <Target Name="GetPythonRuntimeFiles" Returns="@(PythonRuntime)" DependsOnTargets="$(GetPythonRuntimeFilesDependsOn)" />
  25. <Target Name="$$PYTHON_TARGET$$" Returns="@(PythonRuntime)">
  26. <ItemGroup>
  27. <_PythonRuntimeExe Include="$(PythonHome)\python*.dll" />
  28. <_PythonRuntimeExe Include="$(PythonHome)\vcruntime140.dll" />
  29. <_PythonRuntimeExe Include="$(PythonHome)\python*.exe" Condition="$(IncludePythonExe) == 'true'" />
  30. <_PythonRuntimeExe>
  31. <Link>%(Filename)%(Extension)</Link>
  32. </_PythonRuntimeExe>
  33. <_PythonRuntimeDlls Include="$(PythonHome)\DLLs\*.pyd" />
  34. <_PythonRuntimeDlls Include="$(PythonHome)\DLLs\*.dll" />
  35. <_PythonRuntimeDlls>
  36. <Link>DLLs\%(Filename)%(Extension)</Link>
  37. </_PythonRuntimeDlls>
  38. <_PythonRuntimeLib Include="$(PythonHome)\Lib\**\*" Exclude="$(PythonHome)\Lib\**\*.pyc;$(PythonHome)\Lib\site-packages\**\*" />
  39. <_PythonRuntimeLib Remove="$(PythonHome)\Lib\distutils\**\*" Condition="$(IncludeDistutils) != 'true'" />
  40. <_PythonRuntimeLib Remove="$(PythonHome)\Lib\lib2to3\**\*" Condition="$(IncludeLib2To3) != 'true'" />
  41. <_PythonRuntimeLib Remove="$(PythonHome)\Lib\ensurepip\**\*" Condition="$(IncludeVEnv) != 'true'" />
  42. <_PythonRuntimeLib Remove="$(PythonHome)\Lib\venv\**\*" Condition="$(IncludeVEnv) != 'true'" />
  43. <_PythonRuntimeLib>
  44. <Link>Lib\%(RecursiveDir)%(Filename)%(Extension)</Link>
  45. </_PythonRuntimeLib>
  46. <PythonRuntime Include="@(_PythonRuntimeExe);@(_PythonRuntimeDlls);@(_PythonRuntimeLib)" />
  47. </ItemGroup>
  48. <Message Importance="low" Text="Collected Python runtime from $(PythonHome):%0D%0A@(PythonRuntime->' %(Link)','%0D%0A')" />
  49. </Target>
  50. </Project>