You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
waf_old/docs/book/examples/scenarios_idl/wscript

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)