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

ethan09 ethanwwei at gmail.com
Thu Aug 23 16:21:37 EDT 2012


I have a tree like this and want to do an out-of-tree build, but
getting the error "Source directory cannot be under variant directory"
that confuses me: my source dir is homedir/src/proj/src, while my
variant_dir is homedir/tmp/, that doesn't seem to be the case.

Similar problems include:
http://scons.tigris.org/ds/viewMessage.do?dsForumId=1268&dsMessageId=2638863
but in that case scons did not complain. According to the original
poster, the manpage says something "variant_dir may not be underneath
src_dir ", which is understandable. Your help is highly appreciated.

src/proj
|- SConstruct
\-src
|- foo.in
\-SConscript

$ pwd
/home/users/<myid>/src/proj

$ cat SConstruct
import os
vdir = os.getcwdu()
VariantDir(vdir, 'src')
SConscript(vdie + '/SConscript')

$ cat src/SConscript
env = Enviroment()
env.Command('foo.out', 'foo.in', "cp $SOURCE $TARGET")

Now I want to build in an empty variant directory:

$ cd /home/users/<myid>/tmp/ # an empty directory
$ scons -f ../src/proj/SConstruct
scons: Reading SConscript files ...

scons: *** Source directory cannot be under variant directory.
File "/home/users/<myid>/src/proj/SConstruct", line 3, in <module>

Thanks,
EW


More information about the Scons-users mailing list