2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-21 17:12:22 +00:00
Files
python/pyste/tests/SConstruct
Bruno da Silva de Oliveira c7ea0aacd6 - Lots of fixes in the documentation
- Fixed support for return_opaque_pointer policy


[SVN r18199]
2003-04-08 01:01:32 +00:00

60 lines
1.5 KiB
Python

import glob
import sys
import os
# constants
if sys.platform == 'win32':
BOOST_ROOT = 'D:/Programming/Libraries/boost-cvs'
STLPORT_ROOT = 'D:/Programming/Libraries/stlport-4.5.3'
PYTHON_ROOT = 'C:/Python'
if BOOST_ROOT:
BOOST_INCLUDE = BOOST_ROOT + '/boost'
BOOST_LIB = BOOST_ROOT + '/lib'
if STLPORT_ROOT:
STLPORT_INCLUDE = STLPORT_ROOT + '/stlport'
STLPORT_LIB = STLPORT_ROOT + '/lib'
if PYTHON_ROOT:
PYTHON_INCLUDE = PYTHON_ROOT + '/include'
PYTHON_LIB = PYTHON_ROOT + '/libs'
LIBS = ['boost_python', 'python22']
INCLUDES = ['../example']
if sys.platform == 'win32':
CXX = 'icl'
CXXFLAGS='/GR /GX /MD /nologo'
INCLUDES += [BOOST_INCLUDE, STLPORT_INCLUDE, PYTHON_INCLUDE]
LIBPATH = [STLPORT_LIB, PYTHON_LIB, BOOST_LIB]
else:
CXX = 'g++'
CXXFLAGS = ''
LIBPATH = []
#INCLUDES = ['..']
# Create the environment
env = Environment(
CXX=CXX,
CXXFLAGS=CXXFLAGS,
CPPPATH=INCLUDES,
LIBS=LIBS,
LIBPATH=LIBPATH)
# Build all the cpp files
modules = [os.path.splitext(os.path.basename(x))[0] for x in glob.glob('../example/*.pyste')]
for module in modules:
multiple = ARGUMENTS.get('multiple', '')
example_cpp = '../example/%s.cpp' % module
if os.path.isfile(example_cpp):
sources = [example_cpp]
else:
sources = []
if multiple:
env.SharedLibrary(target=module, source=sources + glob.glob('_%s/*.cpp'%module))
else:
env.SharedLibrary(target=module, source=sources + ['_%s.cpp' % module])