Sharing precompiled headers

Hello everybody,

Calitko currently uses Qt.h to generate a precompiled header from. All used to be fine until we split the project into a number of subprojects (calitko-lib, tester, calitko-app). Normally GCC allows for reusing of precompiled headers but one of the conditions is that both projects have the same DEFINEs or the differences don’t have effect in the headers included from the precompiled header. Unfortunately, calitko-lib and tester are of different types (lib and a console app) and Qt adds different additional defines in lib and app builds. The result is that the precompiled header is created for calitko-lib but cannot be reused in tester and therefore it is ignored, thus causing much slower compilation.

One solution would be to split tester into calitko-test (a lib containing the tests) and tester (a console app linking calitko-lib and calitko-test). The drawback is that this would increase the build times. My experience is that linking takes very long and we will have an additional linking of the tester app.

Maybe someone has other ideas or knows how we could speedup linking a bit?

Regards,
Peter

Would you like to post a relpy?


This post starts a thread.
Follow-ups:
Re: Sharing precompiled headers
I just thought that the best solution would be to share object files as well. We won't need the libraries, we will only have two projects: one for the tester (more...)