50 lines
1.5 KiB
Python
50 lines
1.5 KiB
Python
## -*- python -*-
|
|
import Action
|
|
import Object
|
|
import Params
|
|
import Task
|
|
|
|
|
|
def build(bld):
|
|
bindgen = bld.create_obj('command-output')
|
|
bindgen.stdout = 'foomodule.cc'
|
|
bindgen.argv = [bindgen.input_file('foomodulegen.py')]
|
|
bindgen.command = bindgen.env['PYTHON']
|
|
bindgen.command_is_external = True
|
|
bindgen.prio = 55 # must run after the 'py' objects in ../pybindgen
|
|
|
|
obj = bld.create_obj('cpp', 'shlib', 'pyext')
|
|
obj.source = [
|
|
'foo.cc',
|
|
'foomodule.cc'
|
|
]
|
|
obj.target = 'foo'
|
|
obj.inst_var = 0 # do not install
|
|
|
|
## Workaround a WAF bug (http://code.google.com/p/waf/issues/detail?id=37)
|
|
obj.env.append_value("CPPPATH", bld.m_curdirnode.srcpath(obj.env))
|
|
|
|
|
|
if bld.env()['ENABLE_PYGCCXML']:
|
|
### Same thing, but using gccxml autoscanning
|
|
bindgen = bld.create_obj('command-output')
|
|
bindgen.stdout = 'foomodule2.cc'
|
|
bindgen.argv = [bindgen.input_file('foomodulegen-auto.py'), bindgen.input_file('foo.h')]
|
|
bindgen.command = bindgen.env['PYTHON']
|
|
bindgen.command_is_external = True
|
|
bindgen.prio = 55 # must run after the 'py' objects in ../pybindgen
|
|
|
|
obj = bld.create_obj('cpp', 'shlib', 'pyext')
|
|
obj.source = [
|
|
'foo.cc',
|
|
'foomodule2.cc'
|
|
]
|
|
obj.target = 'foo2'
|
|
obj.inst_var = 0 # do not install
|
|
|
|
## Workaround a WAF bug (http://code.google.com/p/waf/issues/detail?id=37)
|
|
obj.env.append_value("CPPPATH", bld.m_curdirnode.srcpath(obj.env))
|
|
|
|
|
|
bld.add_subdirs('c-hello')
|