Boost logo

Boost-Build :

From: Reece Dunn (msclrhd_at_[hidden])
Date: 2005-11-18 04:13:03


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 :(

> 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:

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.

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?

HTH,
- Reece


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