Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Back a long time ago I used to use pre-compiled headers: a. to speed compilation and b. because I supported multiple development tools like CodeWarrior, MPW, VS, ProjectBuilder, gcc, intel compilers, etc, etc.

Now I have a Mac Pro with 32gb of RAM.

Now I use just CMake.

So do we really need pre-compiled headers any more?

Are there obvious benefits that I just dont see/know?

How can one make a cross-platform pre-compiled header? Maybe that would simplify my life too.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
297 views
Welcome To Ask or Share your Answers For Others

1 Answer

There is no such thing as a build that is "Fast enough". Proponents of TDD (Test-Driven Development) will be upset if their build takes longer than a few seconds because it makes turnaround on their development style much slower.

I've worked on projects with hours of compilation time that we halved (or better) by working with pre-compiled headers the right way, so the benefit can be quite large especially for projects that have neglected build times for a while.

However, the preferred solution remains that compilation times never get that far out of hand, by controlling the physical dependencies of the code.

For more information read The Care and Feeding of Pre-compiled Headers


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...