From 9fde01f46c499ee214d8c6b79abd876c7ff5cdc1 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 15 Mar 2019 22:15:34 +0100 Subject: Add custom configuration context --- extras/autowaf.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'extras/autowaf.py') diff --git a/extras/autowaf.py b/extras/autowaf.py index a7aa639..39bed3a 100644 --- a/extras/autowaf.py +++ b/extras/autowaf.py @@ -4,7 +4,7 @@ import subprocess import sys import time -from waflib import Build, Context, Logs, Options, Utils +from waflib import Configure, Build, Context, Logs, Options, Utils from waflib.TaskGen import feature, before, after global g_is_child @@ -102,6 +102,16 @@ def add_flags(opt, flags): opt.add_option('--' + name, action='store_true', dest=name.replace('-', '_'), help=desc) +class ConfigureContext(Configure.ConfigurationContext): + """configures the project""" + + def __init__(self, **kwargs): + super(ConfigureContext, self).__init__(**kwargs) + + def build_path(self, path='.'): + """Return `path` within the build directory""" + return str(self.path.get_bld().find_node(path)) + def get_check_func(conf, lang): if lang == 'c': return conf.check_cc -- cgit v1.2.1