From: Vladimir Prus (ghost_at_[hidden])
Date: 2005-09-23 03:40:11
On Friday 23 September 2005 12:27, Reece Dunn wrote:
> Vladimir Prus wrote:
> > On Thursday 15 September 2005 10:54, Reece Dunn wrote:
> >>>When we talked about it before, the general agreement was to never use
> >>>automatic pch, but instead use manual mode. MSVC users said it's much
> >>>more reliable.
> Precompiled headers are implemented in different ways on different
> toolsets. It would be a good idea to collate this information for all
> the toolsets. I have started with msvc and cw, although I'm not sure how
> the options on CodeWarrior are used. We can then work out how to
> implement PCH support.
> -- pch.jam --
> rule pch ( name : header : source ? )
> # How do we implement this??
If fact, you don't have to implement this at all.
1. Define type PCH. This will automatically define main target rule "pch".
2. The rule will be able to accept as many sources as you pass to it.
3. For msvc, define the generator like this:
generators.register-standard msvc.pch : CPP HPP : PCH : <toolset>msvc ;
Defines the action as appropriate
4. For gcc, define the generator like this:
generators.register-standard gcc.pch : HPP : PCH : <toolset>gcc ;
This will allow
pch whatever : a.cpp a.hpp ;
to work on both msvc and gcc. The latter will just ignore "a.cpp".
-- Vladimir Prus http://vladimir_prus.blogspot.com Boost.Build V2: http://boost.org/boost-build2
Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk