[Scons-users] Creation of an archive of source files with Node.all_children()

Paul Grégoire pg.ensiie at gmail.com
Tue Jan 20 00:01:29 EST 2015


Hi Dirk,

Thank you, your answer makes sense for me, and I realise I never noticed
that scanners are called during the compilation phase and not during the
analysis phase.

So, to solve my problem, I do not imagine a clean solution now. My last
idea is to use the result of the --tree option. Using scons --tree=prune,
perhaps with --dry-run to get the complete list of dependencies, and then
post process this output with an external script to create the archive. I
will try to create such a script. Could you tell me if it is simple to add
an option to the --tree option to obtain an output that will be simpler to
parse with a script ? If it is not simple, I will do the job with one of
the existing output.

Many thanks for your help, I will post my final solution soon.

Best Regards

Paul
Le 16 janv. 2015 21:48, "Dirk Bächle" <tshortik at gmx.de> a écrit :

> Paul,
>
> On 16.01.2015 19:12, Paul Grégoire wrote:
>
>> Hi Dirk,
>>
>> Thanks for the explanation. Unfortunately the workaround that consists in
>> getting all headers with Glob is not really adapted to my
>> situation.
>>
>> I use boost libraries and I would like to archive boost headers that are
>> included from my code, but not all boost headers...
>>
>> I understand why FindSourceFiles cannot process implicit dependencies,
>> but getting headers is really my goal.
>>
>> Could you explain me why using get_allchildren is not recommended and
>> leads to errors ? Or would you have any other workaround more
>> acceptable to me ? Many thanks for the time you spend to help me, I
>> really appreciate.
>>
>>
> you're very welcome. The dependency tracking of SCons is based on having
> "a priori" knowledge of the target and source lists that are required for a
> single build step (like your Tar operation). You need to know which files
> like "main.cpp" go into the build step, such that you can then check
> whether the source file has changed...and the target needs to be rebuilt.
> But you can't know implicit dependency files (like the "define.h" header)
> in advance, because the CPP files are scanned for "#include" statements
> during the build phase. The dependency DAG is *not* known in advance, it's
> constructed on the fly...starting at the targets given on the command-line
> (or the "." dir as default), and then expanding the actions/children down
> to the leaves (existing source files).
> So, you would have to defer the Emitter of your Builder until after *all*
> other Builders have been executed, such that you can then use
> FindSourceFiles (or all_children) on the complete file tree, and only then
> execute the TAR Builder finally. But there is no interface for this...sorry.
>
> Does this make things clearer for you?
>
>
> Regards,
>
> Dirk
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20150120/61bd968f/attachment.html>


More information about the Scons-users mailing list