summaryrefslogtreecommitdiffstats
path: root/PCbuild
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2022-04-07 22:21:03 (GMT)
committerGitHub <noreply@github.com>2022-04-07 22:21:03 (GMT)
commitb0ec17b6d9e0fb61081b6d15a1b2a14b607851b7 (patch)
tree2caa6fa0a0c064f64718807e6ae1a06b967b84bd /PCbuild
parent877fd622e81989e6e9cb5401ac4974c9fd5a128a (diff)
downloadcpython-b0ec17b6d9e0fb61081b6d15a1b2a14b607851b7.zip
cpython-b0ec17b6d9e0fb61081b6d15a1b2a14b607851b7.tar.gz
cpython-b0ec17b6d9e0fb61081b6d15a1b2a14b607851b7.tar.bz2
bpo-47103: Copy pgort140.dll into output directory when building PGInstrument on Windows (GH-32083)
Diffstat (limited to 'PCbuild')
-rw-r--r--PCbuild/python.vcxproj15
1 files changed, 11 insertions, 4 deletions
diff --git a/PCbuild/python.vcxproj b/PCbuild/python.vcxproj
index b58945a..b6dcf14 100644
--- a/PCbuild/python.vcxproj
+++ b/PCbuild/python.vcxproj
@@ -128,9 +128,6 @@ set PYTHONPATH=$(PySourcePath)Lib
</Target>
<Target Name="GeneratePythonBat" AfterTargets="AfterBuild">
<PropertyGroup>
- <_PGOPath Condition="$(Configuration) == 'PGInstrument' and $(Platform) == 'Win32'">@set PATH=%PATH%%3B$(VCInstallDir)bin</_PGOPath>
- <_PGOPath Condition="$(Configuration) == 'PGInstrument' and $(Platform) == 'x64'">@set PATH=%PATH%%3B$(VCInstallDir)bin\amd64</_PGOPath>
- <_PGOPath Condition="$(Configuration) == 'PGInstrument' and $(VC_PGO_RunTime_Dir) != ''">@set PATH=%PATH%%3B$(VC_PGO_RunTime_Dir)</_PGOPath>
<_Content>@rem This script invokes the most recently built Python with all arguments
@rem passed through to the interpreter. This file is generated by the
@rem build process and any changes *will* be thrown away by the next
@@ -140,11 +137,21 @@ set PYTHONPATH=$(PySourcePath)Lib
@echo Running $(Configuration)^|$(Platform) interpreter...
@setlocal
@set PYTHONHOME=$(PySourcePath)
-$(_PGOPath)
@"$(OutDir)python$(PyDebugExt).exe" %*
</_Content>
<_ExistingContent Condition="Exists('$(PySourcePath)python.bat')">$([System.IO.File]::ReadAllText('$(PySourcePath)python.bat'))</_ExistingContent>
</PropertyGroup>
<WriteLinesToFile File="$(PySourcePath)python.bat" Lines="$(_Content)" Overwrite="true" Condition="'$(_Content)' != '$(_ExistingContent)'" />
</Target>
+ <Target Name="CopyPGORT" AfterTargets="Link" Condition="$(Configuration) == 'PGInstrument'">
+ <ItemGroup>
+ <_PGORT Include="$(VCToolsInstallDir)bin\Hostx86\x86\pgort140.dll" Condition="$(Platform) == 'Win32'" />
+ <_PGORT Include="$(VCToolsInstallDir)bin\Hostx64\x64\pgort140.dll" Condition="$(Platform) == 'x64'" />
+ <_PGORT Include="$(VCToolsInstallDir)bin\arm64\pgort140.dll" Condition="$(Platform) == 'ARM64'" />
+ </ItemGroup>
+ <Warning Text="Unable to locate pgort140.dll for $(Platform)." Condition="@(_PGORT) == '' or !Exists(@(_PGORT))" />
+ <Copy SourceFiles="@(_PGORT)" DestinationFolder="$(OutDir)">
+ <Output TaskParameter="CopiedFiles" ItemName="FileWrites" />
+ </Copy>
+ </Target>
</Project>