akmhoque | fa8ee9b | 2014-03-14 09:06:24 -0500 | [diff] [blame^] | 1 | #! /usr/bin/env python |
| 2 | # encoding: utf-8 |
| 3 | # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file |
| 4 | |
| 5 | from waflib import Task,Errors |
| 6 | from waflib.TaskGen import taskgen_method,before_method |
| 7 | @taskgen_method |
| 8 | def add_dbus_file(self,filename,prefix,mode): |
| 9 | if not hasattr(self,'dbus_lst'): |
| 10 | self.dbus_lst=[] |
| 11 | if not'process_dbus'in self.meths: |
| 12 | self.meths.append('process_dbus') |
| 13 | self.dbus_lst.append([filename,prefix,mode]) |
| 14 | @before_method('apply_core') |
| 15 | def process_dbus(self): |
| 16 | for filename,prefix,mode in getattr(self,'dbus_lst',[]): |
| 17 | node=self.path.find_resource(filename) |
| 18 | if not node: |
| 19 | raise Errors.WafError('file not found '+filename) |
| 20 | tsk=self.create_task('dbus_binding_tool',node,node.change_ext('.h')) |
| 21 | tsk.env.DBUS_BINDING_TOOL_PREFIX=prefix |
| 22 | tsk.env.DBUS_BINDING_TOOL_MODE=mode |
| 23 | class dbus_binding_tool(Task.Task): |
| 24 | color='BLUE' |
| 25 | ext_out=['.h'] |
| 26 | run_str='${DBUS_BINDING_TOOL} --prefix=${DBUS_BINDING_TOOL_PREFIX} --mode=${DBUS_BINDING_TOOL_MODE} --output=${TGT} ${SRC}' |
| 27 | shell=True |
| 28 | def configure(conf): |
| 29 | dbus_binding_tool=conf.find_program('dbus-binding-tool',var='DBUS_BINDING_TOOL') |