1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
## -*- python -*-
def configure(conf):
pass
def build(bld):
#
# PyBindGen
#
gen = bld(
features='command',
source='testapi-pybindgen.py',
target='testapimodule.cc',
command='${PYTHON} ${SRC[0]} > ${TGT[0]}')
obj = bld('cxx', 'shlib', 'pyext')
obj.source = [
'testapi.cc',
'testapimodule.cc'
]
obj.target = 'testapi_pybindgen'
obj.install_path = None # do not install
obj.includes = '.'
#
# Boost::Python
#
obj = ('cxx', 'shlib', 'pyext')
obj.source = [
'testapi.cc',
'testapi_boost.cc'
]
obj.target = 'testapi_boost'
obj.install_path = None # do not install
obj.includes = '.'
obj.env.append_value('LIB', 'boost_python-mt')
#
# SWIG
#
gen = bld(
features='command',
source='testapi_swig.i',
target='testapi_swig_module.cc',
command='swig -c++ -o ${TGT[0]} -python ${SRC[0]}')
obj = bld('cxx', 'shlib', 'pyext')
obj.source = [
'testapi.cc',
'testapi_swig_module.cc'
]
obj.target = '_testapi_swig'
obj.install_path = None # do not install
obj.includes = '.'
#
# SIP
#
gen = bld(
features='command',
source='testapi.sip',
target='sipAPItestapi_sip.h siptestapi_sipcmodule.cpp siptestapi_sipMultiplier.cpp',
command='sip -c default/benchmarks ${SRC[0]}')
obj = bld('cxx', 'shlib', 'pyext')
obj.source = [
'testapi.cc',
'siptestapi_sipcmodule.cpp',
'siptestapi_sipMultiplier.cpp',
]
obj.target = 'testapi_sip'
obj.install_path = None # do not install
obj.includes = '.'
# SIP does not like -fvisibility=hidden :-(
l = list(obj.env['CXXFLAGS_PYEXT'])
l.remove("-fvisibility=hidden")
obj.env['CXXFLAGS_PYEXT'] = l
|