Viladoman / CompileScore

Tools for profiling and visualizing C++ build times.
MIT License
464 stars 19 forks source link

Added accumulated exclusive and start/stop trace cmd #41

Closed honkstar1 closed 1 year ago

honkstar1 commented 1 year ago
Viladoman commented 1 year ago

Thanks for the PR! That's sweet. I really appreciate it. I might need to accommodate the accumulated exclusive to some local changes I have moving forward. In general it looks good.

honkstar1 commented 1 year ago

Perfect, thank you. I've added so UnrealVS (Unreal's visual studio plugin) can build single file through unreal's build system and profile using Compile score.. it is a sweet workflow for reducing include dependencies.

Viladoman commented 1 year ago

I would like to still integrate your PR and then I can adapt whatever on top.

I am really interested on your usage of the new commands with UnrealVS. Sadly I am not super familiar with Unreal, would it be possible to write a small text on how to use it so we can add it to our wiki page here?

Thanks for your support.

honkstar1 commented 1 year ago

Lol, I thought "close" was the same as handing it over to you... I am a total n00b when it comes to github 🤣

I would really appreciate if you could pull it in to main.

Unreal has its own build tool (not using msbuild etc). when building projects visual studio just run a cmd line through the NMAKE api which hands the work over to the custom build tool.

Most of the time when building unreal (and games on top of unreal) you are using "unity" files. They go under many names and are essentially a cpp that includes 30-50 other cpp files.

However, now and then you want to build an individual file (or in compile score's case output the include graph which is super awesome).. and to do that we need to add additional options to this nmake cmd line. The way we are doing it is through a visual studio extension called UnrealVS.

What I did was extending that so before we call our cmd line which starts the build of one file I call UnrealVSPackage.Instance.DTE.ExecuteCommand("CompileScore.StartTrace"); .. and when compile is done I call UnrealVSPackage.Instance.DTE.ExecuteCommand("CompileScore.StopTrace");

and everything pops up in visual studio the way you want it to. It is really nice.

Btw, here's unreal on github: https://github.com/EpicGames/UnrealEngine

We have been integrating include-what-you-use into the build system too which is cool. I've used it to clean up includes in 25000+ files in unreal/fortnite. We are doing a big push in compile times and are currently working with microsoft vs devs to get "header units" working in unreal :-)