Skip to content

Commit ced66bd

Browse files
committed
always clean the profile directory when doing a new clang PGO build
This better matches the behaviour of build.bat in case of MSVC PGO builds.
1 parent 7b46aeb commit ced66bd

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

PCbuild/pythoncore.vcxproj

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,8 +717,16 @@
717717
</Target>
718718

719719
<Target Name="EnsureClangProfileDir" BeforeTargets="PrepareForBuild"
720-
Condition="$(PlatformToolset) == 'ClangCL' and $(Configuration) == 'PGInstrument'">
721-
<MakeDir Directories="$(ClangProfileDir)" Condition="!Exists($(ClangProfileDir))" />
720+
Condition="$(PlatformToolset) == 'ClangCL' and $(Configuration) == 'PGInstrument' and !Exists($(ClangProfileDir))">
721+
<MakeDir Directories="$(ClangProfileDir)" />
722+
</Target>
723+
724+
<Target Name="CleanClangProfileDir" BeforeTargets="PrepareForBuild"
725+
Condition="$(PlatformToolset) == 'ClangCL' and $(Configuration) == 'PGInstrument' and Exists($(ClangProfileDir))">
726+
<ItemGroup>
727+
<FilesToDelete Include="$(ClangProfileDir)\*.*"/>
728+
</ItemGroup>
729+
<Delete Files="@(FilesToDelete)" TreatErrorsAsWarnings="true" />
722730
</Target>
723731

724732
<Target Name="MergeClangProfileData" BeforeTargets="PrepareForBuild"

0 commit comments

Comments
 (0)