[Scons-users] Out of tree build getting "Source directory cannot be under variant directory" error

Evan Driscoll driscoll at cs.wisc.edu
Thu Aug 23 16:27:30 EDT 2012


On 08/23/2012 03:21 PM, ethan09 wrote:

> $ cat SConstruct

> import os

> vdir = os.getcwdu()

> VariantDir(vdir, 'src')

>

> ...

>

> $ cd /home/users/<myid>/tmp/ # an empty directory

> $ scons -f ../src/proj/SConstruct


I haven't actually tried this, but I'm pretty sure that in this case,
os.getcwdu() will *not* return your ~/<mvid>/tmp directory. Before
reading an SConscript (including SConstruct), SCons chdirs to the
directory that SConscript is in. Thus you're trying to set the bulid
directory to src/proj.

Try GetLaunchDir() instead: "Returns the absolute path name of the
directory from which scons was initially invoked. This can be useful
when using the -u, -U or -D options, which internally change to the
directory in which the SConstruct file is found."

Evan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 545 bytes
Desc: OpenPGP digital signature
Url : <http://four.pairlist.net/pipermail/scons-users/attachments/20120823/b062241d/attachment.pgp>


More information about the Scons-users mailing list