2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-19 04:22:16 +00:00

Fix Windows builds.

This commit is contained in:
Stefan Seefeld
2017-02-15 15:36:01 -05:00
parent edd890bd2b
commit 3066c73c09
4 changed files with 24 additions and 4 deletions

View File

@@ -39,6 +39,7 @@ arch = ARGUMENTS.get('arch', platform.machine())
env_vars = {}
if 'CXX' in os.environ: env_vars['CXX'] = os.environ['CXX']
if 'CXXFLAGS' in os.environ: env_vars['CXXFLAGS'] = os.environ['CXXFLAGS'].split()
env_vars['ENV'] = os.environ #{'PATH': os.environ['PATH'], 'TMP' : os.environ['TMP']}
env = Environment(toolpath=['config/tools'],
tools=['default', 'libs', 'tests', 'doc', 'sphinx4scons'],
variables=vars,

View File

@@ -69,13 +69,15 @@ install:
# pip will build them from source using the MSVC compiler matching the
# target Python version and architecture
- easy_install scons
- easy_install sphinx
- pip install numpy
#- "%CMD_IN_ENV% pip install -r dev-requirements.txt"
build_script:
# Build the compiled extension
#- "%CMD_IN_ENV% python setup.py build"
- scons config arch=%ARCH% --boost-include=%BOOST_PREFIX%
- scons arch=%ARCH%
- scons arch=%ARCH% --verbose
test_script:
# Run the project tests

View File

@@ -10,9 +10,11 @@
Import('env')
env.AppendUnique(CPPDEFINES = ["${LINK_DYNAMIC and 'BOOST_PYTHON_DYN_LINK=1' or ''}"])
env.AppendUnique(CPPDEFINES = ['BOOST_PYTHON_SOURCE'])
env.BoostLibrary(
env1 = env.Clone()
env1.AppendUnique(CPPDEFINES = ['BOOST_PYTHON_SOURCE'])
env1.BoostLibrary(
'python',
['numeric.cpp',
'list.cpp',
@@ -44,7 +46,13 @@ env.BoostLibrary(
'object/function_doc_signature.cpp'])
if env['NUMPY']:
env.BoostLibrary(
env2 = env.Clone()
env2.Append(CPPPATH=env['NUMPY_CPPPATH'])
build_dir = env.Dir('$BOOST_CURRENT_VARIANT_DIR/src')
env2.AppendUnique(CPPDEFINES = ['BOOST_NUMPY_SOURCE'],
LIBPATH = [build_dir],
LIBS='boost_python' + env["BOOST_SUFFIX"])
env2.BoostLibrary(
'numpy',
['numpy/dtype.cpp',
'numpy/matrix.cpp',

View File

@@ -8,9 +8,18 @@
# http://www.boost.org/LICENSE_1_0.txt)
import platform
import sys
Import('env')
if sys.platform == 'win32':
# HACK: This works around a bug in SCons.
# subprocess.check_output will complain unless all environment
# variables are strings.
system_root = env['ENV']['SystemRoot']
env['ENV']['SystemRoot'] = str(system_root)
# libs needed for embedding
ELIBS=env['LIBS'] + env['PYTHONLIBS']