[Scons-users] Variant directory

Dirk Bächle tshortik at gmx.de
Wed May 7 12:36:44 EDT 2014


Hi,

On 07.05.2014 00:51, Russell, J.J. wrote:

> I am puzzled by how to properly use 'src_dir' in SConscript

>

> If, in the SConstruct file I specify

>

> SConscript ('pkg/SConscript', variant_dir='pkg/build', src_dir='pkg/src', duplicate=0)

>

> where pkg/src contains foo.c

>

> I get Program ('foo.c') successfully built.

>

> However, if I remove the 'pkg' from the variant_dir, i.e.

>

> SConscript ('pkg/SConscript', variant_dir='build', src_dir='pkg/src', duplicate=0)

>

> The files in 'src/' no longer can be found unless I prepend them with 'src/', i.e. src/foo.c

>

> Any help on the rules of the game with src_dir would be greatly appreciated.


here's a simple set of rules:

#1 : Don't use src_dir.
#2 : Tell your friends to not do so either.
#3 : Continue reading with rule #1.

Today, the "src_dir" parameter is a leftover from the ancient times when
there was no support for "variant_dir" in the SConscript call directly.
What it does is, it changes the current working directory (on OS level,
and in the internal "lookup" file system tree) before executing the
given SConscript. So it's good for one thing...confusing users. ;)
That's also why you won't find any lengthy explanation of "src_dir" in
the MAN page and User Guide, its usage is discouraged.

Your actual question is difficult to answer, without knowing what's
inside your "pkg/SConscript". Can you share it with us?

Best regards,

Dirk



More information about the Scons-users mailing list