I want to incorporate PGO into the Visual C++ build steps in an automated fashion.
Specifically, I wish to be able to:
Select a build configuration (let's call it Release (PGO)
)
Click Build Solution (or Build Project)
Simply wait for Visual Studio to:
a. Build an instrumented version of my project
b. Automatically invoke the executable with some command line (e.g. --benchmark
) and wait for it to exit
c. Collected the instrumentation data from that execution
d. Build a profile-guided-optimized version of my project
Discover the PGO-optimized binary lying in my output directory
Is such a thing possible, and if so, how do I achieve it?
For your requirement, please check whether the target section is what you want:
And the time of the targets' trigger:
You can put the automatic steps in a script, and use exec to run it:
Such as:
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<Exec Command="xxx" />
</Target>