Skip to content

Commit 3066c73

Browse files
committed
Fix Windows builds.
1 parent edd890b commit 3066c73

File tree

4 files changed

+24
-4
lines changed

4 files changed

+24
-4
lines changed

SConstruct

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ arch = ARGUMENTS.get('arch', platform.machine())
3939
env_vars = {}
4040
if 'CXX' in os.environ: env_vars['CXX'] = os.environ['CXX']
4141
if 'CXXFLAGS' in os.environ: env_vars['CXXFLAGS'] = os.environ['CXXFLAGS'].split()
42+
env_vars['ENV'] = os.environ #{'PATH': os.environ['PATH'], 'TMP' : os.environ['TMP']}
4243
env = Environment(toolpath=['config/tools'],
4344
tools=['default', 'libs', 'tests', 'doc', 'sphinx4scons'],
4445
variables=vars,

appveyor.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,13 +69,15 @@ install:
6969
# pip will build them from source using the MSVC compiler matching the
7070
# target Python version and architecture
7171
- easy_install scons
72+
- easy_install sphinx
73+
- pip install numpy
7274
#- "%CMD_IN_ENV% pip install -r dev-requirements.txt"
7375

7476
build_script:
7577
# Build the compiled extension
7678
#- "%CMD_IN_ENV% python setup.py build"
7779
- scons config arch=%ARCH% --boost-include=%BOOST_PREFIX%
78-
- scons arch=%ARCH%
80+
- scons arch=%ARCH% --verbose
7981

8082
test_script:
8183
# Run the project tests

src/SConscript

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,11 @@
1010
Import('env')
1111

1212
env.AppendUnique(CPPDEFINES = ["${LINK_DYNAMIC and 'BOOST_PYTHON_DYN_LINK=1' or ''}"])
13-
env.AppendUnique(CPPDEFINES = ['BOOST_PYTHON_SOURCE'])
1413

15-
env.BoostLibrary(
14+
env1 = env.Clone()
15+
env1.AppendUnique(CPPDEFINES = ['BOOST_PYTHON_SOURCE'])
16+
17+
env1.BoostLibrary(
1618
'python',
1719
['numeric.cpp',
1820
'list.cpp',
@@ -44,7 +46,13 @@ env.BoostLibrary(
4446
'object/function_doc_signature.cpp'])
4547

4648
if env['NUMPY']:
47-
env.BoostLibrary(
49+
env2 = env.Clone()
50+
env2.Append(CPPPATH=env['NUMPY_CPPPATH'])
51+
build_dir = env.Dir('$BOOST_CURRENT_VARIANT_DIR/src')
52+
env2.AppendUnique(CPPDEFINES = ['BOOST_NUMPY_SOURCE'],
53+
LIBPATH = [build_dir],
54+
LIBS='boost_python' + env["BOOST_SUFFIX"])
55+
env2.BoostLibrary(
4856
'numpy',
4957
['numpy/dtype.cpp',
5058
'numpy/matrix.cpp',

test/SConscript

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,18 @@
88
# http://www.boost.org/LICENSE_1_0.txt)
99

1010
import platform
11+
import sys
1112

1213
Import('env')
1314

15+
if sys.platform == 'win32':
16+
# HACK: This works around a bug in SCons.
17+
# subprocess.check_output will complain unless all environment
18+
# variables are strings.
19+
system_root = env['ENV']['SystemRoot']
20+
env['ENV']['SystemRoot'] = str(system_root)
21+
22+
1423
# libs needed for embedding
1524
ELIBS=env['LIBS'] + env['PYTHONLIBS']
1625

0 commit comments

Comments
 (0)