[SCons] Add 'dump' command line target, and update FAQ

This commit is contained in:
Ray Speth 2014-03-28 23:12:06 +00:00
parent 50344cb34f
commit 5c99f683df
2 changed files with 26 additions and 8 deletions

View file

@ -38,7 +38,7 @@ if not COMMAND_LINE_TARGETS:
sys.exit(0)
valid_commands = ('build','clean','install','uninstall',
'help','msi','samples','sphinx','doxygen')
'help','msi','samples','sphinx','doxygen','dump')
for command in COMMAND_LINE_TARGETS:
if command not in valid_commands and not command.startswith('test'):
@ -146,11 +146,6 @@ env = Environment(tools=toolchain+['textfile', 'subst', 'recursiveInstall', 'wix
toolchain=toolchain,
**extraEnvArgs)
#
# To print the current environment
#
# print env.Dump()
env['OS'] = platform.system()
env['OS_BITS'] = int(platform.architecture()[0][:2])
if 'cygwin' in env['OS'].lower():
@ -1571,3 +1566,9 @@ if any(target.startswith('test') for target in COMMAND_LINE_TARGETS):
for name in env['testNames']:
print 'test-%s' % name
sys.exit(0)
### Dump (debugging SCons)
if 'dump' in COMMAND_LINE_TARGETS:
# Typical usage: 'scons build dump'
print env.Dump()
sys.exit(0)

View file

@ -2,8 +2,8 @@
Frequently Asked Questions
**************************
Installation
------------
Installation & Compilation
--------------------------
**How do I install Cantera on Windows?**
@ -18,6 +18,23 @@ Installation
<https://sourceforge.net/projects/cantera/files/cantera/>`_ and follow the
instructions in the :ref:`sec-compiling`.
**How do I debug issues with the SCons build system?**
Sometimes, it is helpful to see all of the internal variables defined by
SCons, either automatically or by the Cantera build scripts. To do this, add
``dump`` to your SCons command line. For example::
$ scons build dump
will show the variables that would be set during the ``build`` step. Note
that in this case, the ``build`` step will not be executed.
Alternatively, it is also possible to run SCons through the Python debugger, and set a breakpoint in the ``SConstruct`` file. For example::
$ scons --debug=pdb build
(Pdb) b /full/path/to/SConstruct:33
(Pdb) cont
General
-------