[Scons-users] Emiter usage

Adam Dobrowolski pholat at gmail.com
Mon Sep 19 15:47:19 EDT 2016


Hi,

I want to build all four elements which have "Alias" at once, I've added Alias 
to mark that these are end products. 
Right now the main question is if SCons will recognize intermediate files 
needed if I loop over them, not write them by hand/copy in SConsctruct. 
I vaguely recall that SConstruct & SConscripts are being parsed before any 
functions are executed.

So right now it's a question on SCons dependency handling.
---
By the way:
The mail has "Emitter usage" in name because:
1) I ate word "question" - sorry for that, I've just found it out.
2) I read manual: http://scons.org/doc/1.2.0/HTML/scons-user/x3603.html and I 
thought that maybe I could do something similar. In the end I still see no use 
in emitter in my case and can't grasp when I would need it. ( I would be 
grateful to any explanations though ) 

Best regards,
Adam

On poniedziałek, 19 września 2016 19:31:56 CEST Dirk Bächle wrote:
> Adam,
> 
> On 19.09.2016 18:46, Adam Dobrowolski wrote:
> > Hi Dirk,
> > 
> > Great thanks up to now, I meant something like that:
> > 
> > #!/bin/python
> > 
> > x86_env = Environment(<something for x86);
> > x86_deb = env.Clone();
> > x86_deb.Append(CXXFLAGS=['-g3','-O2'])
> > arm_env = Environment(<something for arm>);
> > arm_deb = env.Clone();
> > arm_deb.Append(CXXFLAGS=['-g3','-O2'])
> > 
> > libs = [
> > 
> >          "lib1/SConscript",
> >          "lib2/SConscript",
> >          "lib3/SConscript",
> >          (...)
> >          "libN/SConscript",
> >          ]
> > 
> > for script in libs:
> >      SConscript(script, exports={'env' : x86_env},
> >      variant_dir='x86_release')
> >      SConscript(script, exports={'env' : x86_deb},
> >      variant_dir='x86_debug')
> >      SConscript(script, exports={'env' : arm_env},
> >      variant_dir='arm_release')
> >      SConscript(script, exports={'env' : arm_deb},
> >      variant_dir='arm_debug')
> > 
> > # These SConscripts use products of earlier SConscripts in for loop
> > # For 10 SCOnscripts it would be 40 products in total
> > # These are sourced with Glob("*")
> > X86_REL = SConscript("x86_release/SConcsript")
> > X86_DEB = SConscript("x86_debug/SConcsript")
> > ARM_REL = SConscript("arm_release/SConcsript")
> > ARM_DEB = SConscript("arm_debug/SConcsript")
> > 
> > Alias('X86_REL',X86_REL)
> > Alias('X86_DEB',X86_DEB)
> > Alias('ARM_REL',ARM_REL)
> > Alias('ARM_DEB',ARM_DEB)
> 
> what I get from this is that you want to be able to call "scons X86_REL",
> such that only the corresponding subtree is built. If this
> is correct, doesn't it contradict the specifications made in your first mail:
>  > What I need to do is:
>  > Generate different output on different compilation variable.
>  > 
>  > Exemplary problem: one app version is build with -DDEBUG variable, and
>  > second one is without. Now I can build DEBUG app (or one without) by
>  > changing the Environment by hand. But I would love to build both in one
>  > run.
> , especially for the last sentence?
> 
> Regards,
> 
> Dirk
> 
> 
> _______________________________________________
> Scons-users mailing list
> Scons-users at scons.org
> https://pairlist4.pair.net/mailman/listinfo/scons-users




More information about the Scons-users mailing list