[QBS] Generate pre compiled headers

olivier musse olivier.musse at sfr.fr
Thu May 22 19:28:01 CEST 2014

> On 21-May-14 00:08, olivier musse wrote:
>> 1) The file pch_headers.h is well generated on the build directory if in
>> my PchHeaders Group I select files with extension other than .h . When
>> I use .h extension, the pch_headers.h is not generated as if there are
>> some interferences between the cpp module "hpp" tag and my "pch" tag.
>> Does it may be the issue? Can I do something for it to work?
> This should work... but it doesn't - as I just noticed.
> I've created QBS-593 to track this.
Ok, thanks for taking time to check on your side and adding a bug.
>> 2) the line
>> cpp.cxxPrecompiledHeader:product.buildDirectory+"/pch_headers.h" seem to
>> have no effect when put in the Module. I try to put it directly in the
>> product and then it warn me that the artifact is not in the list of
>> source files. For the pch_headers.h to be pre compiled, I need to put it
>> manually in the source directory and add to project
> Right. What you're trying to do is highly dependent on the current
> implementation of the PCH handling in the cpp module. We never designed
> it for this use case.
> Not sure whether this is possible without altering the implementation in
> the cpp module.

This is a bad news, we use to do that with qmake so that a precompile 
header is automatically generated using most of our .h files but also by 
adding Qt files according to the Qt module dependencies.
What is not designed for that in cpp module, the fact that the 
pch_header files is in buildDirectory or the fact that i'm setting it 
from a Module and not the product itself.
I'm sure it is possible to find a solution even if not optimal.



More information about the Qbs mailing list