mirror of
https://gitlab.com/ita1024/waf.git
synced 2024-11-23 02:16:01 +01:00
36 lines
644 B
Python
36 lines
644 B
Python
#! /usr/bin/env python
|
|
|
|
"""
|
|
An idl task
|
|
$ waf configure clean build
|
|
"""
|
|
|
|
top = '.'
|
|
out = 'build'
|
|
|
|
def configure(conf):
|
|
conf.load('g++')
|
|
|
|
def build(bld):
|
|
bld.program(
|
|
source = 'foo.idl main.cpp',
|
|
target = 'myapp',
|
|
includes = '.'
|
|
)
|
|
|
|
from waflib.Task import Task
|
|
from waflib.TaskGen import extension
|
|
|
|
class idl(Task):
|
|
run_str = 'cp ${SRC} ${TGT[0].abspath()} && touch ${TGT[1].abspath()}'
|
|
color = 'BLUE'
|
|
ext_out = ['.h']
|
|
|
|
@extension('.idl')
|
|
def process_idl(self, node):
|
|
cpp_node = node.change_ext('.cpp')
|
|
hpp_node = node.change_ext('.hpp')
|
|
self.create_task('idl', node, [cpp_node, hpp_node])
|
|
self.source.append(cpp_node)
|
|
|