Skip to content
This repository has been archived by the owner on Feb 14, 2018. It is now read-only.

Commit

Permalink
[SCons] Fix build errors when path to Python contains spaces
Browse files Browse the repository at this point in the history
Adaptation of trunk r3075.

git-svn-id: https://cantera.googlecode.com/svn/cantera/branches/2.1@3158 02a645c2-efd0-11dd-984d-ab748d24aa7e
  • Loading branch information
speth committed Sep 12, 2014
1 parent f31c8cb commit 9598c73
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -864,6 +864,7 @@ if env['HAS_SUNDIALS'] and env['use_sundials'] != 'n':

env = conf.Finish()

env['python_cmd_esc'] = quoted(env['python_cmd'])

# Python 2 Package Settings
cython_min_version = LooseVersion('0.17')
Expand Down Expand Up @@ -1253,7 +1254,7 @@ for cti in mglob(env, 'data/inputs', 'cti'):
outName = os.path.splitext(cti.name)[0] + '.xml'
convertedInputFiles.add(outName)
build(env.Command('build/data/%s' % outName, cti.path,
'$python_cmd interfaces/python/ctml_writer.py $SOURCE $TARGET'))
'$python_cmd_esc interfaces/python/ctml_writer.py $SOURCE $TARGET'))


# Copy input files which are not present as cti:
Expand Down
2 changes: 1 addition & 1 deletion interfaces/cython/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ if localenv['python_package'] == 'new':
build(make_setup)

build_base = ('cd interfaces/cython &&'
' $python_cmd setup2.py %s'
' $python_cmd_esc setup2.py %s'
' --build-lib=../../build/python2'
' --build-temp=../../build/temp-py2'
+ compilerOpt)
Expand Down
10 changes: 5 additions & 5 deletions src/python/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ elif localenv['python_package'] == 'minimal':

moddir = pjoin('interfaces', 'python')
localenv.AddPostAction(make_setup,
'cd %s && $python_cmd setup.py build %s' % (moddir,
extraArgs))
'cd %s && $python_cmd_esc setup.py build %s' % (moddir,
extraArgs))

# Install the Python module
if localenv['python_prefix'] == 'USER':
Expand All @@ -88,7 +88,7 @@ else:

if localenv['PYTHON_INSTALLER'] == 'direct':
mod_inst = install(localenv.Command, 'dummy', pymodule,
'cd %s && $python_cmd setup.py install %s' % (moddir,extra) +
'cd %s && $python_cmd_esc setup.py install %s' % (moddir,extra) +
' --record ../../build/python-installed-files.txt')
global_env = env
def find_module_dir(target, source, env):
Expand All @@ -104,11 +104,11 @@ if localenv['PYTHON_INSTALLER'] == 'direct':

elif localenv['PYTHON_INSTALLER'] == 'debian':
install(localenv.Command, 'dummy', pymodule,
'cd %s && $python_cmd setup.py install %s --install-layout=deb --no-compile' % (moddir,extra))
'cd %s && $python_cmd_esc setup.py install %s --install-layout=deb --no-compile' % (moddir,extra))
env['python_module_loc'] = '<unspecified>'
elif localenv['PYTHON_INSTALLER'] == 'binary':
install(localenv.Command, 'dummy', pymodule,
'cd %s && $python_cmd setup.py bdist_msi --dist-dir=../..' % moddir +
'cd %s && $python_cmd_esc setup.py bdist_msi --dist-dir=../..' % moddir +
' --target-version=' + distutils.sysconfig.get_python_version())
env['python_module_loc'] = '<unspecified>'

Expand Down

0 comments on commit 9598c73

Please sign in to comment.