views:

71

answers:

1

OK, I have old Metrowerks code for Mac and Windows where the previous developer used pre-compiled headers for every project that this code base builds.

How does one get rid of Pre-compiled headers, conceptually?

do you take the contents of a .pch and move them to a core.h and include that in all of your classes .h files?

I want to move to building with CMAKE and although there are hacks to make pre-compiled headers work, I think that it would be best to remove dependencies to them.

Some may say things about compile speed, but I am not in a race, I have fast equipment already, I am more interested in how to get away from pre-compiled headers.

A: 

How does one get rid of Pre-compiled headers, conceptually?

Precompiled headers are an optimization. Conceptually you get rid of the precompiled headers by simply using the regular headers instead.

do you take the contents of a .pch and move them to a core.h and include that in all of your classes .h files?

I know programmers who do this. Personally I prefer to know which functions I'm using and where they came from, so I make sure each file #includes all the headers needed to compile that file (and only the headers needed to compile that file). Then again, this does require constantly checking if a header is no longer necessary.

Max Lybbert