@@ -133,9 +133,6 @@ set PYTHONPATH=$(PySourcePath)Lib
133133 </Target >
134134 <Target Name =" GeneratePythonBat" AfterTargets =" AfterBuild" >
135135 <PropertyGroup >
136- <_PGOPath Condition =" $(Configuration) == 'PGInstrument' and $(Platform) == 'Win32'" >@set PATH=%PATH%%3B$(VCInstallDir)bin</_PGOPath >
137- <_PGOPath Condition =" $(Configuration) == 'PGInstrument' and $(Platform) == 'x64'" >@set PATH=%PATH%%3B$(VCInstallDir)bin\amd64</_PGOPath >
138- <_PGOPath Condition =" $(Configuration) == 'PGInstrument' and $(VC_PGO_RunTime_Dir) != ''" >@set PATH=%PATH%%3B$(VC_PGO_RunTime_Dir)</_PGOPath >
139136 <_Content >@rem This script invokes the most recently built Python with all arguments
140137@rem passed through to the interpreter. This file is generated by the
141138@rem build process and any changes *will* be thrown away by the next
@@ -145,11 +142,21 @@ set PYTHONPATH=$(PySourcePath)Lib
145142@echo Running $(Configuration)^|$(Platform) interpreter...
146143@setlocal
147144@set PYTHONHOME=$(PySourcePath)
148- $(_PGOPath)
149145@"$(OutDir)python$(PyDebugExt).exe" %*
150146</_Content >
151147 <_ExistingContent Condition =" Exists('$(PySourcePath)python.bat')" >$([System.IO.File]::ReadAllText('$(PySourcePath)python.bat'))</_ExistingContent >
152148 </PropertyGroup >
153149 <WriteLinesToFile File =" $(PySourcePath)python.bat" Lines =" $(_Content)" Overwrite =" true" Condition =" '$(_Content)' != '$(_ExistingContent)'" />
154150 </Target >
151+ <Target Name =" CopyPGORT" AfterTargets =" Link" Condition =" $(Configuration) == 'PGInstrument'" >
152+ <ItemGroup >
153+ <_PGORT Include =" $(VCToolsInstallDir)bin\Hostx86\x86\pgort140.dll" Condition =" $(Platform) == 'Win32'" />
154+ <_PGORT Include =" $(VCToolsInstallDir)bin\Hostx64\x64\pgort140.dll" Condition =" $(Platform) == 'x64'" />
155+ <_PGORT Include =" $(VCToolsInstallDir)bin\arm64\pgort140.dll" Condition =" $(Platform) == 'ARM64'" />
156+ </ItemGroup >
157+ <Warning Text =" Unable to locate pgort140.dll for $(Platform)." Condition =" @(_PGORT) == '' or !Exists(@(_PGORT))" />
158+ <Copy SourceFiles =" @(_PGORT)" DestinationFolder =" $(OutDir)" >
159+ <Output TaskParameter =" CopiedFiles" ItemName =" FileWrites" />
160+ </Copy >
161+ </Target >
155162</Project >
0 commit comments