|
Boost-Build : |
Subject: Re: [Boost-build] Preprocessed output
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2011-03-29 14:34:26
AMDG
On 03/29/2011 11:10 AM, Edward Diener wrote:
> How do I tell Boost Build to generate preprocessed output, either when
> using the 'compile' rule or using some other rule ?
>
> I tried, for gcc, adding an -E to the command line as a cxxflag but the
> compile rule still attempted to compile the file and no output was
> produced. I need to send preprocessed output to a file without compiling
> the preprocessed output.
>
I don't think there's a way to do this at present.
It shouldn't be too hard to add, though. There would
need to be a new target type and rules in the toolset
modules to generate it.
I needed this for my template profiler, but I only
implemented it for msvc and gcc and not in a particularly
reusable way.
a) Does it need to distinguish between C and C++?
I think so, since we want exactly the same compiler
flags that would be passed to create an object file.
b) What should the name of the type be? This will
also control the name of the main target rule.
c) What should the extension be. I know msvc uses .i
by default for preprocessor output. Unless they're
already used by something else, we could make it
.i and .ipp.
In Christ,
Steven Watanabe
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