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/architecture_link/wscript

37 lines
790 B
Python

#! /usr/bin/env python
"""
This example demonstrates how to create custom compilation and link tasks
NOTE: to avoid redefining the method call_apply_link, you could use this:
import waflib.TaskGen
waflib.TaskGen.feats['mylink'] = ['apply_link']
"""
def configure(ctx):
pass
def build(ctx):
ctx(features='mylink', source='foo.ext faa.ext', target='bingo')
from waflib.Task import Task
from waflib.TaskGen import feature, extension, after_method
from waflib.Tools import ccroot
@after_method('process_source')
@feature('mylink')
def call_apply_link(self):
self.apply_link()
class mylink(ccroot.link_task):
run_str = 'cat ${SRC} > ${TGT}'
class ext2o(Task):
run_str = 'cp ${SRC} ${TGT}'
@extension('.ext')
def process_ext(self, node):
self.create_compiled_task('ext2o', node)