dotnet / runtime

.NET is a cross-platform runtime for cloud, mobile, desktop, and IoT apps.
https://docs.microsoft.com/dotnet/core/
MIT License
15.12k stars 4.7k forks source link

Need a way to build a RELEASE build without PGD data #8304

Closed BruceForstall closed 4 years ago

BruceForstall commented 7 years ago

If I want to build a RELEASE build on Windows without PGD data (that is, specifically preventing PGD data from being used), is there a way to do so? Ideally, I could pass something like "nopgo" to build.cmd.

It looks like right now I need to hack pgosupport.cmake to command out or remove these two lines:

set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS_RELEASE        " /LTCG /USEPROFILE:PGD=${ProfilePath}")
set_property(TARGET ${TargetName} APPEND_STRING PROPERTY LINK_FLAGS_RELWITHDEBINFO " /LTCG /USEPROFILE:PGD=${ProfilePath}")        

?

dpodder commented 7 years ago

At the moment the easiest way is to add skiprestoreoptdata (and make sure the packages weren't already restored: ./clean.sh -p or clean.cmd -p.

There are plans to add a switch like pgo:off (exact syntax TBD). I can work on this and get it wrapped up pretty quickly once 2.0 validation winds down.