From f597546a9cad8a98434f63cde459b710646d3195 Mon Sep 17 00:00:00 2001 From: Steven Knight Date: Thu, 8 Jan 2009 16:40:36 +0000 Subject: Issue 2279: Support $SWIGOUTDIR values with spaces in the directory name. (Arve Knudsen) --- src/CHANGES.txt | 2 ++ src/engine/SCons/Tool/swig.py | 2 +- test/SWIG/SWIGOUTDIR.py | 17 +++++++++++------ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/CHANGES.txt b/src/CHANGES.txt index e793527..76cca21 100644 --- a/src/CHANGES.txt +++ b/src/CHANGES.txt @@ -28,6 +28,8 @@ RELEASE 1.X - XXX - Document TestCommon.shobj_prefix variable. + - Support $SWIGOUTDIR values with spaces. + From Gary Oberbrunner: - Allow AppendENVPath() and PrependENVPath() to interpret '#' diff --git a/src/engine/SCons/Tool/swig.py b/src/engine/SCons/Tool/swig.py index eb4ca79..08f8cd4 100644 --- a/src/engine/SCons/Tool/swig.py +++ b/src/engine/SCons/Tool/swig.py @@ -112,7 +112,7 @@ def generate(env): env['SWIGFLAGS'] = SCons.Util.CLVar('') env['SWIGCFILESUFFIX'] = '_wrap$CFILESUFFIX' env['SWIGCXXFILESUFFIX'] = '_wrap$CXXFILESUFFIX' - env['_SWIGOUTDIR'] = '${"-outdir " + str(SWIGOUTDIR)}' + env['_SWIGOUTDIR'] = r'${"-outdir \"%s\"" % SWIGOUTDIR}' env['SWIGPATH'] = [] env['SWIGINCPREFIX'] = '-I' env['SWIGINCSUFFIX'] = '' diff --git a/test/SWIG/SWIGOUTDIR.py b/test/SWIG/SWIGOUTDIR.py index e0f3f25..a875e80 100644 --- a/test/SWIG/SWIGOUTDIR.py +++ b/test/SWIG/SWIGOUTDIR.py @@ -55,7 +55,7 @@ env = Environment(tools = ['default', 'swig'], Java_foo_interface = env.SharedLibrary( 'Java_foo_interface', 'Java_foo_interface.i', - SWIGOUTDIR = 'java/build', + SWIGOUTDIR = 'java/build dir', SWIGFLAGS = '-c++ -java -Wall', SWIGCXXFILESUFFIX = "_wrap.cpp") """ % locals()) @@ -64,19 +64,24 @@ test.write('Java_foo_interface.i', """\ %module foopack """) -# SCons should realize that it needs to create the java/build -# subdirectory to hold the generate .java files. +# SCons should realize that it needs to create the "java/build dir" +# subdirectory to hold the generated .java files. test.run(arguments = '.') +test.must_exist('java/build dir/foopackJNI.java') +test.must_exist('java/build dir/foopack.java') + # SCons should remove the built .java files. -test.run(arguments = '-c java/build/foopack.java java/build/foopackJNI.java') +test.run(arguments = '-c') -test.must_not_exist('java/build/foopackJNI.java') -test.must_not_exist('java/build/foopack.java') +test.must_not_exist('java/build dir/foopackJNI.java') +test.must_not_exist('java/build dir/foopack.java') # SCons should realize it needs to rebuild the removed .java files. test.not_up_to_date(arguments = '.') +test.must_exist('java/build dir/foopackJNI.java') +test.must_exist('java/build dir/foopack.java') test.pass_test() -- cgit v0.12