[Scons-users] Enhancement request 2957: Set site_scons using an envrionment variable

Dirk Bächle tshortik at gmx.de
Fri Jun 27 03:11:21 EDT 2014


Hey Matthew,

On 27.06.2014 03:35, Matthew Swabey wrote:
>
> Apologies for "chatting" on the enhancement request.
>

thanks for coming over to the mailing list.

> The situation I find myself in is this:
>
> 1 repo holds HDL files, some reference libraries, a local copy of 
> scons 2.3.1 and lots of individual modules of HDL representing bus 
> structures, CPUs, etc.
>
> Each of the modules of HDL has a top level SConstruct that calls 
> SConstructs to build that module and other modules as necessary to run 
> the testbenches. This means a particular SConscript may be referenced 
> by several SConstruct's.
>
> This gives rise to 12 different SConstruct files at different levels 
> in the repo's directory hierarchy.
>

Are you sure that you have to keep those SConstructs separated? From 
what you write, I get the impression that there are actually some 
dependencies between the single modules involved. If this is true, the 
more "SCons"ish approach would be to have one single top-level 
SConstruct, which includes all SConscript of the other modules. This 
way, SCons can see the whole project tree and is able to correctly 
deduce the dependency graph.
By adding Aliases and specifying targets on the command-line, you could 
still choose to only build parts of the project tree...like a certain 
sub-module for example.

This would also remove the annoying task of setting up your environment 
in each SConstruct. You could do this once at the top-level, and then 
hand the environment down to your module SConscripts.

Another idea would be to write your own Tool for setting up the 
environment as you need it.

Regards,

Dirk



More information about the Scons-users mailing list