[Scons-users] Creation of an archive of source files with Node.all_children()
pg.ensiie at gmail.com
Fri Jan 16 04:03:14 EST 2015
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
This is my new SConstruct :
env = Environment()
foo = env.Program('foo', 'main.cpp')
and the result :
% scons --tree=prune
scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
tar -c -f all_sources.tar SConstruct main.cpp
g++ -o main.o -c -I. main.cpp
g++ -o foo main.o
| | +-main.cpp
| | +-define.h
| | +-/usr/bin/g++
scons: done building targets.
As you can see, define.h is not included in the archive, but it is
found as dependency for main.o.
Would you have any idea about that ? For me, define.h should be
included in the dependencies of all_sources.tar, so do not hesitate to
tell me if I make a mistake.
I attach the complete project to this mail.
PS: my version of scons :
% scons --version
SCons by Steven Knight et al.:
script: v2.3.4, 2014/09/27 12:51:43, by garyo on lubuntu
engine: v2.3.4, 2014/09/27 12:51:43, by garyo on lubuntu
engine path: ['/usr/local/lib/scons-2.3.4/SCons']
Copyright (c) 2001 - 2014 The SCons Foundation
Running on Debian 7 64bits
2015-01-15 22:13 GMT+01:00 Dirk Bächle <tshortik at gmx.de>:
> Hi Paul,
> On 15.01.2015 11:09, Paul Grégoire wrote:
>> Sorry to add some noise here, but I am still interested in a solution
>> for this problem. I did some other tests without success.
> don't worry, and thanks a lot for your patience.
>>> I try to create an archive of all the sources and dependancies of my
>>> project. I have tested the FindSourceFiles() method, but this method
>>> only reports the cpp files and not the associated headers files, so I
>>> tried to implement it myself.
> You shouldn't have to parse for the children by yourself. In the example
> version you provided
>>> scons: Building targets ...
>>> tar -c -f sub/all_sources.tar sub/define.inc sub/main.cpp /usr/bin/g++
> you're also adding executables to the archive, which is probably not what
> you want. I can't reproduce the ".sconsign.dblite" error on my side, but I
> attached my solution...please try it out and see if it works for you. The
> main difference is that I set CPPPATH, such that the header file "define.h"
> can get found during the scanning process...and is properly added to the
> list of sources.
> Best regards,
> Scons-users mailing list
> Scons-users at scons.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 435 bytes
Desc: not available
More information about the Scons-users