[Scons-users] Question over variant directory, and default script name

RW garlicbready at googlemail.com
Sun May 7 08:37:34 EDT 2017


Hi,
I've recently been looking at using SCons
since I'm quite into python and this is a very easy to read and easy to
debug build system.

1. The first question is surrounding the variant directory
I'm not sure if this is by design. But I've noticed with the variant_dir
option for SConscript. The destination directory for the build needs to be
underneath the location of the SConscript file

So for example this will not work (just claims the build is up to date):
import os.path as path
testdir1 = path.abspath('../../Build/LibBuild/glue')
SConscript('ExampleSource/SConscript.py', variant_dir=testdir1)

This however will work:
import os.path as path
testdir1 = path.abspath('Build/LibBuild/glue')
SConscript('ExampleSource/SConscript.py', variant_dir=testdir1)

It's not that big of an issue since I can just place a script at the root
of the project which calls the other script lower down.
and place the variant directory in the root script
Not sure if this is by design, a bug, or a feature request.


2. The second question I think is more of a feature request
Typically I use Visual Studio with python tools for writing and debugging
python. However VS only recognizes python scripts if the file extension is
.py

The way I get around this is to have the following in the SConstruct file
execfile('SConstruct.py')

Followed by the real script in the SConstruct.py file
to get intelisense working within Visual Studio I usually also place the
following at the top of the script (which isn't needed but helps auto
completion)
import SCons.Script
from SCons.Environment import Environment

Would it be possible to set Scons to use SConstruct.py if SConstruct isn't
detected in the directory?

For info I put up a blog post a while back on debugging SCons scripts
within Visual Studio via python tools
http://grbd.github.io/posts/2016/07/27/scons-builds-with-visual-studio/

Many Thanks,
Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://pairlist4.pair.net/pipermail/scons-users/attachments/20170507/f0244dfe/attachment.html>


More information about the Scons-users mailing list