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

Paul Grégoire pg.ensiie at gmail.com
Fri Jan 16 13:12:02 EST 2015

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.

Best Regards

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

> Paul,
> On 16.01.2015 10:03, Paul Grégoire wrote:
>> Hi Dirk,
>> Thank you for your answer, your solution works fine, and it works even
>> if I remove the line "env.Append('CPPPATH=['.']).
>> The result is : tar -c -f sub/all_sources.tar sub/SConscript
>> sub/main.cpp sub/define.inc    => exactly what I expected.
>> But, if I remove the generation of the file define.h from define.inc,
>> and the subdirectory to simplified, the archive does not contain
>> define.h anymore.
> unfortunately the FindSourceFiles() method can't detect implicit
> dependencies to existing files, like the "define.h" in your case. The
> problem is that at the time of calling FindSourceFiles(), no scanning has
> been done yet (we're still in the parsing phase). So SCons simply doesn't
> know that the file node exists yet.
> This is different from the former setup, where the 'define.h' got created
> from 'define.inc' via a Builder. In that case, the file nodes for the
> target and the source are already created in what I call the VFS (virtual
> file system, an internal data structure that keeps track of which
> files/dirs should/will exist), so the FindSourceFiles() can find them.
> One workaround is to create a file node for the header file, before
> calling FindSourceFiles():
>     env = Environment()
>     env.Append(CPPPATH=['.'])
>     env.File('define.h')
>     foo = env.Program('foo', 'main.cpp')
>     env.Tar('foo', FindSourceFiles())
> An env.File(Glob('*.h')) should work fine in general...
> 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/20150116/3529bc5e/attachment.html>

More information about the Scons-users mailing list