summaryrefslogtreecommitdiff
path: root/test/SWIG/module-deduced-name.py
diff options
context:
space:
mode:
Diffstat (limited to 'test/SWIG/module-deduced-name.py')
-rw-r--r--test/SWIG/module-deduced-name.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/SWIG/module-deduced-name.py b/test/SWIG/module-deduced-name.py
index 733b6c117..bdaef4f98 100644
--- a/test/SWIG/module-deduced-name.py
+++ b/test/SWIG/module-deduced-name.py
@@ -32,6 +32,7 @@ emitter should return the basename of the module only.
import TestSCons
import os
+import sys
test = TestSCons.TestSCons()
@@ -45,8 +46,15 @@ Python_h = os.path.join(python_include, 'Python.h')
if not os.path.exists(Python_h):
test.skip_test('Cannot find %s, skipping test.\n' % Python_h)
+# 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 -c++',
+ %(swig_arch_var)s
CPPPATH=[r"%(python_include)s"],
SWIG=[r'%(swig)s'],
SWIGOUTDIR='python/build dir',