Boost logo

Boost-Build :

From: Juergen Hunold (hunold_at_[hidden])
Date: 2005-11-18 05:20:32


Hi Reece !

On Friday 18 November 2005 10:13, Reece Dunn wrote:
> Juergen Hunold wrote:
> > Hi Reece !
> >
> > On Thursday 17 November 2005 23:15, Reece Dunn wrote:
> >> Reece Dunn wrote:
> >>> I have attached a patch to add PCH support to the msvc toolset.
> >>> This is most likely the most complex toolset to get PCH support
> >>> on, so extending this for other toolsets should be trivial.
> >
> > Well, I've taken a quick shot at gcc, but I'm lost.
> > Am I correct that your patch change the compile action to _always_
> > require a pch file ?
>
> Hmm. I think so :(

That's bad. Rationale see below.

> > The query is: How do I get a command line _without_ the -Fp
> > switches in order to compile _without_ pch's ?
>
> You don't need the -Fp switches. You would have something like:

Oh, misunderstanding here. What I meant was:
How do I disable pch completly.
Or: How to get the old, much simpler commandlines back again when not
using pchs ?
When pchs are disabled, I'd like the compiler not to use _any_ , even
fake pch's.
This means, I don't want any mention of pch on the commandline when they
are disabled.
I think this is a key requirement and one of the results of the past
dicscusions about pch files.
Unfortunately, this seems to be the hardest part of the issue as you
must somehow switch between pch and non-pch in <toolset>.jam...

> action compile.pch
> {
> $(.CC) compile your PCH here.
> ECHO dummy > $(<[2]:W)
> }
>
> this will create a dummy mypch.pch file. If you need to do any
> special compilation, that goes in the $(.CC) line. If you don't need
> to do anything there, just delete the line.

Understood.

> Then, you would have:
>
> flags gcc.compile PCH_HEADER <pch>on : <pch-header> ;
>
> rule compile.c++ ( targets + : sources * : properties * )
> {
> DEPENDS $(<) : [ on $(<) return $(PCH_HEADER) ] ;
> }
>
> action compile.c++ bind PCH_HEADER
> {
> $(.CC) ... -pch"$(PCH_HEADER)"
> }
>
> where -pch"..." adds the mypch.hpp file to the command line.
>
> Is that all that is required? If not, what else is needed by GCC?

Well, I got gcc to create the pch file. But I doubt that gcc will take
an empty file and create an empty pch file.

I'll hack a few tests for this ....

Yours,

Jürgen

-- 
* Dipl.-Math. Jürgen Hunold  ! Institut für Verkehrswesen, Eisenbahnbau
* voice: ++49 511 762-2529   ! und -betrieb, Universität Hannover  
* fax  : ++49 511 762-3001   ! Appelstrasse 9a, D-30167 Hannover
* hunold_at_[hidden] ! www.ive.uni-hannover.de

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