[Scons-users] Advice sought

Dominic Binks dominic.binks at thebinkles.net
Sun Feb 8 16:33:34 EST 2015

On 08/02/2015 20:41, Dirk Baechle wrote:
> Dominic,
> Am 08.02.2015 um 20:28 schrieb Dominic Binks:
>> Sure.
>> The file builds probably 200 files.  We use a couple of third party
>> libraries which contribute most of this count.  I estimate about
>> half will go to target, approximately half to host, and probably 10%
>> that will go to both.
>> VariantDirs may solve my problem, but I've not yet had a feel for how
>> to make them work for it.  I had thought to do something like
>> that but from what I've read on the wiki, to use VariantDir you need
>> to map the source files to the variant.
> just on this one point: Don't use VariantDir directly! Instead, look at
> section 15.1 "Specifying a Variant Directory Tree as Part of an
> SConscript Call" in the UserGuide. You can also find a simple example of
> the basic setup in the "pyconde_2013/examples/exvar" folder of
>    https://bitbucket.org/dirkbaechle/scons_talks
> . When used correctly, variant dirs allow you to write your SConscripts
> *without* referring to one of your "build" folders.

Yes we already do this.  I was trying it out outside of SConscript()s 
because the form inside the SConscript()s was not working the way I need 
it to and, unless I'm very much mistaken, won't supply what I need.

As far as I understand it, using SConscript to make different builds 
works brilliantly when the two builds are built from the same sources 
(e.g. debug and release builds).  However, this is not the case for our 
builds - the host and target builds differ significantly.

Again, if I have understood this correctly with applying a variant_dir 
in the SConscript() calls I would need to arrange the rest of the build 
in one of the following ways (or even both).

1. Arrange for SConscripts to only refer to host side compilation, or 
target side compilation and not both, then the SConstruct will read the 
target side SConscripts with one environment and the host side 
SConscripts with a different environment.
2. Arrange for the environment to indicate in some way whether it is 
currently compiling for host or target.

Option 1 is unappealing because it means that code that is logically 
connected (e.g. messaging) is now split between two different files thus 
making comprehension more difficult and increasing the likelihood of 

Option 2 is unappealing because every object will need to look at the 
environment to see if it is currently building for that system.

If I'm not right about this, can you point me to some documentation that 
explains or provides some kind of example of doing something different?


> 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