[Scons-users] Out of project tree builds

William Deegan bill at baddogconsulting.com
Sat Oct 27 23:23:23 EDT 2012


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


More information about the Scons-users mailing list