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

Dirk Bächle tshortik at gmx.de
Fri Jan 16 15:48:31 EST 2015


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?



More information about the Scons-users mailing list