Boost logo

Boost-Build :

From: Johan Nilsson (r.johan.nilsson_at_[hidden])
Date: 2007-10-05 03:54:55

Vladimir Prus wrote:
> On Friday 05 October 2007 10:25:03 Johan Nilsson wrote:
>> Hi,
>> after attempting to use precompiled headers toghether with gcc
>> 4.1.2, I figured I might as well post my "findings" here.
>> Pre-4.2.0 gcc can't handle pch and anonymous namespaces in headers,
>> ref:
>> This makes it virtually impossible to use pch toghether with e.g.
>> Boost.Lambda, Boost.Parameter to build programs with multiple
>> translation units.
>> Perhaps a note of this could be added to the BBv2 pch docs?
> Possibly, thanks for letting know.

Also, it seems like the base name of the pch header needs to be exactly the
same as the pch target name. Does the provided example (in the docs) really

>> Also - is it possible to disable pch using conditional requirements,
>> making the pch rule effectively returning a "null" target?
> The <pch>off feature will have that effect.

Thanks. However, adding <toolset>gcc:<pch>off to my root project properties
caused everything to rebuild as /pch-off/ was added to the target paths. Not
much to do about it I guess, but annoying nevertheless.

Is there possibly a way to obtain the effect of the imagined conditional
requirement "<toolset>gcc,<toolset-version-below>4.2.0:<pch>off" without
resorting to indirect conditional requirements?

One final point: Inside the pch target definition, I also setup the path to
the pch header as an <include> requirement as I have multiple levels of
source directories within the project. As a result of this, when turning off
pch, the source files fails to compile (they no longer find the actual pch
header file).

Do you have any suggestions for how to handle the above in a generic, clean

/ Johan

Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at