diff options
Diffstat (limited to 'test/SWIG/subdir.py')
-rw-r--r-- | test/SWIG/subdir.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/test/SWIG/subdir.py b/test/SWIG/subdir.py index 0b9f24d..e23b858 100644 --- a/test/SWIG/subdir.py +++ b/test/SWIG/subdir.py @@ -39,7 +39,7 @@ import TestSCons if sys.platform == 'win32': _dll = '.dll' else: - _dll = '.so' + _dll = '.so' test = TestSCons.TestSCons() @@ -58,14 +58,21 @@ if not os.path.exists(Python_h): # handle testing on other platforms: ldmodule_prefix = '_' +# On Windows, build a 32-bit exe if on 32-bit python. +if sys.platform == 'win32' and sys.maxsize <= 2**32: + swig_arch_var="TARGET_ARCH='x86'," +else: + swig_arch_var="" + test.write('SConstruct', """ env = Environment(SWIGFLAGS='-python', + %(swig_arch_var)s CPPPATH=['%(python_include)s/'], LDMODULEPREFIX='%(ldmodule_prefix)s', LDMODULESUFFIX='%(_dll)s', SWIG=r'%(swig)s', LIBPATH=[r'%(python_libpath)s'], - LIBS='%(python_lib)s', + LIBS='%(python_lib)s' ) env.LoadableModule('sub/_foo', |