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
|
## -*- python -*-
def build(bld):
## manual code generation using simple pybindgen API calls
gen = bld(
features='command',
source='modulegen.py',
target='amodule.cc',
command='${PYTHON} ${SRC[0]} > ${TGT[0]}')
if bld.env['CXX']:
obj = bld(features=['cxx', 'cxxshlib', 'pyext'])
obj.source = [
'a.cc',
'amodule.cc'
]
obj.target = 'a'
obj.install_path = None # do not install
obj.includes = '.'
if bld.env['ENABLE_PYGCCXML']:
## gccxml direct generation method
bld(
features='command',
source='module-autogen.py a.h',
target='a1module.cc',
command='${PYTHON} ${SRC[0]} ${SRC[1]} > ${TGT[0]}')
obj = bld(features=['cxx', 'cxxshlib', 'pyext'])
obj.source = [
'a.cc',
'a1module.cc'
]
obj.target = 'a1'
obj.install_path = None # do not install
obj.includes = '.'
## gccxml indirect generation method
bld(
features='command',
source='module-autoscan.py a.h',
target='a2modulegen.py',
command='${PYTHON} ${SRC[0]} ${SRC[1]} > ${TGT[0]}')
bld(
features='command',
source='a2modulegen.py',
target='a2module.cc',
command='${PYTHON} ${SRC[0]} > ${TGT[0]}')
obj = bld(features=['cxx', 'cxxshlib', 'pyext'])
obj.source = [
'a.cc',
'a2module.cc'
]
obj.target = 'a2'
obj.install_path = None # do not install
obj.includes = '.'
|