[Scons-users] Out of project tree builds

Francis Bolduc fbolduc at gmail.com
Sun Oct 28 12:48:37 EDT 2012



> "scons" === "scons ."


I never understood this design choice, and I've been struggling
because of it since I started using SCons.

Why isn't it rather "scons" === "scons /", so that if you don't
specify what you want built, it builds everything everywhere.

It seems to me like the idea was to make some kind of hierarchical
thing where there would be SConstruct files in sub-directories, just
like Make projects do.

But this clashes with out-of-source builds, becauses it forces you to
put build products somewhere below SConstruct, that is, in the source.

--
Francis Bolduc, B.Sc.


On Sat, Oct 27, 2012 at 11:23 PM, William Deegan
<bill at baddogconsulting.com> wrote:

> Russel,

>

> On Oct 27, 2012, at 2:38 PM, Russel Winder <russel at winder.org.uk> wrote:

>

>> On Sat, 2012-10-27 at 13:17 -0700, William Deegan wrote:

>> […]

>>> By default SCons builds from the current directory down.

>>> I think adding a Default('../whateverdir') and/or env.Default(..) might do the trick.

>>

>> I suspect, even if it works, that is a hack. User should be able to say:

>>

>> SConstruct('src/SConscript', variant_dir='../../BuildLocation',

>> duplicate=0)

>>

>> and have it work correctly. It not working and not causing SCons to

>> error is I think a definite bug.

>

> I'd have to disagree.

> SCons builds targets under it's invocation directory by default.

> By using variant dir, you're specifying that the target is in the specified variant dir.

> Thus if you specify a directory not under the current directory, it won't get build by default.

> "scons" === "scons ."

>

> >From the man page: (http://www.scons.org/doc/production/HTML/scons-man.html)

>> By default, the command

>>

>> scons

>>

>>

>> will build all target files in or below the current directory. Explicit default targets (to be built when no targets are specified on the command line) may be defined the SConscript file(s) using the Default() function, described below.

>

>

> Not to say that I haven't been caught by this myself, it is slightly non-intuitive, but it is consistent.

>

> -Bill

> _______________________________________________

> Scons-users mailing list

> Scons-users at scons.org

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



More information about the Scons-users mailing list