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

26 lines
489 B
Python

#! /usr/bin/env python
# encoding: utf-8
"""
The variables from cls.vars are then used to compute the task signature
and may trigger rebuilds
"""
from waflib.Task import Task
class foo(Task):
vars = ['FLAGS']
def run(self):
print('the flags are %r' % self.env.FLAGS)
def options(ctx):
ctx.add_option('--flags', default='-f', dest='flags', type='string')
def configure(ctx):
pass
def build(ctx):
ctx.env.FLAGS = ctx.options.flags
tsk = foo(env=ctx.env)
ctx.add_to_group(tsk)