[Scons-users] [scons-users] Replacing Builder while perserving Scanner
Dirk Bächle
tshortik at gmx.de
Sun Jun 15 04:24:21 EDT 2014
Hi,
On 15.06.2014 21:38, yangsc wrote:
>
> Hello,
>
> Now I have some '.input' files to be built to '.obj'-like targets. I
> have written a build action function and replace the env's object builder:
>
> myBuilder = Builder(action = mybuilder.MyBuilder,
>
> src_suffix = '.input',
>
> emitter = mybuilder.MyEmitter)
>
> env.Replace(BUILDERS = {'Object' : myBuilder})
>
> In '.input' files, there are some preprocessor directives as the
> C-Preprocessor has: '#include', '#ifdef' etc. So I want to preserve
> the default C-Scanner.
>
> But when I run the sconscript the default CScanner doesn't work at
> all. I also tried replace 'CFILESUFFIX',' CPPSUFFIXES',' CXXFILESUFFIX' .
>
> So Is there some method can I *use the default C-Scanner* for .h
> dependencies while *use my builder function to build the targets*?
>
please refer to the MAN page, in the section "Scanner objects" you'll
find an example of how to add, or better: link, your scanner to the
additional filename extension ".input". Note, that building targets and
scanning source files are completely independent (well, almost) of each
other...so you can build C/CPP targets and scan ".c"/".h"/".input" files
at the same time.
Best regards,
Dirk
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20140615/1d69660b/attachment.html>
More information about the Scons-users
mailing list