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

44 lines
948 B
Python

#! /usr/bin/env python
"""
Task generators may create any kind of task
In this example, the tasks create configuration contexts
and execute configuration tests.
Execute
$ waf configure build
"""
import os
from waflib.Configure import conf, ConfigurationContext
from waflib import Task, Build, Logs
def run_test(self):
top = self.generator.bld.srcnode.abspath()
out = self.generator.bld.bldnode.abspath()
ctx = ConfigurationContext(top_dir=top, out_dir=out)
ctx.init_dirs()
ctx.in_msg = 1
ctx.env = self.env.derive()
header = self.generator.header_name
logfile = self.generator.path.get_bld().abspath() + os.sep \
+ header + '.log'
ctx.logger = Logs.make_logger(logfile, header)
ctx.check(header_name=header)
def options(ctx):
ctx.load('compiler_c')
def configure(ctx):
ctx.load('compiler_c')
def build(ctx):
ctx(rule=run_test, always=True, header_name='stdio.h')
ctx(rule=run_test, always=True, header_name='unistd.h')