Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PRECOMPILED_HEADER and Subdirs template on Qt

Tags:

c++

qt4

I have a big Qt project, splitted on several static libraries (around 70) and one application, and for that I'm using a .pro file with the subdirs template.

To speed up the compilations time, I want to use precompiled headers and found that using the PRECOMPILED_HEADER on each sub-project does the trick, BUT, every project compiles the precompiled header separately (and that one is the slowest step).

There is a way to "share" the precompiled header between all the subprojects included on the subdirs template?, so the precompiled header can be built once, and be used by all subprojects?

Regards

like image 710
Federico Avatar asked Nov 13 '09 04:11

Federico


1 Answers

After some experimentation I found no way to share a precompiled header between subprojects. I think the rationale behind the lack of this functionality is that each subproject may change compiler / preprocessor flags which would make precompiled headers built for one subproject incompatible with other subprojects.

Shared precompiled header could be useful for some simple projects where compiler flags are also shared, but I guess detecting and handling deviations from this condition would be too much hassle for the qmake.

like image 89
artm Avatar answered Nov 07 '22 13:11

artm