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

Paul Grégoire pg.ensiie at gmail.com
Fri Jan 16 04:03:14 EST 2015


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.
This is my new SConstruct :

<<<
env = Environment()

env.Append(CPPPATH=['.'])
foo = env.Program('foo', 'main.cpp')

env.Tar('all_sources', FindSourceFiles())
>>>

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
+-.
  +-SConstruct
  +-all_sources.tar
  | +-SConstruct
  | +-main.cpp
  | +-/bin/tar
  +-define.h
  +-foo
  | +-main.o
  | | +-main.cpp
  | | +-define.h
  | | +-/usr/bin/g++
  | +-/usr/bin/g++
  +-main.cpp
  +-[main.o]
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.

Best Regards,

Paul

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:
>>
>> Hi,
>>
>> 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++
>>> /bin/cp
>
>
> 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,
>
> Dirk
>
>
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scons_src_pack_2.tar.gz
Type: application/x-gzip
Size: 435 bytes
Desc: not available
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20150116/dd95a6cf/attachment.bin>


More information about the Scons-users mailing list