[Scons-users] Fwd: More than one source directory for a single variant directory

Brady Johnson bradyallenjohnson at gmail.com
Fri Oct 25 13:35:39 EDT 2013


Dirk,

I was looking into this too, but dont have the code at home. Im curious to
know why you cant have two source directory builds placed in the same
variant_dir.

This is a basic idea of how I reproduced it:

*SConstruct*

env = Environment()
env.SConscript('proj1/SConscript', variant_dir='bin', duplicate=0,
exports='env')
env.SConscript('proj2/SConscript', variant_dir='bin', duplicate=0,
exports='env') # This line causes the error mentioned by Yann


*proj1/SConscript*

Import('env')
env.Program(target='proj1', source='proj1.cc')


*proj2/SConscript*

Import('env')
env.Program(target='proj2', source='proj2.cc')


Regards,

Brady








On Fri, Oct 25, 2013 at 1:12 AM, Dirk Bächle <tshortik at gmx.de> wrote:


> Hi Yann,

>

>

> On 24.10.2013 23:51, Yann Bane wrote:

>

>> Hello all,

>>

>> I'm trying to build several programs from source files (in different

>> directory for each program) into a single variant directory (bin).

>>

>> However, scons is erroring out on me with the following message:

>>

>> >scons: *** 'bin' already has a source directory: 'source/prog1'.

>>

>> What's going on here?

>>

>>

> I'm not quite sure, since the code in your SConstruct and the project tree

> in your SO question are slightly out of sync. But I'd like to suggest,

> turning the setup of the SConstructs/SConscripts around a bit for your case.

> I'm assuming that you only need a single "bin" output folder, in which

> case the usage of variant_dir is not necessary.

>

> Try to create simple SConscripts in your "obj" folders and the "bin"

> folder directly, which you include via SConscript() from the top-level

> SConstruct:

>

> env = Environment()

> Export('env')

>

> SConscript('object/prog1/**SConscript')

> SConscript('object/prog2/**SConscript')

>

> SConscript('bin/SConscript')

>

> The sub-SConscripts then look like:

>

> Import('env')

>

> env.SharedObject('program1.os'**,'#src/prog1/program1.cpp')

>

>

> and:

>

> Import('env')

> env.Program('program1','#**object/prog1/program1.os')

>

>

> Best regards,

>

> Dirk

>

> ______________________________**_________________

> Scons-users mailing list

> Scons-users at scons.org

> http://four.pairlist.net/**mailman/listinfo/scons-users<http://four.pairlist.net/mailman/listinfo/scons-users>

>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20131025/358ee874/attachment.html


More information about the Scons-users mailing list