From 7e02a0008d4299a19ea1d13a9c8e89c9fcebb74f Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 15 Sep 2018 08:40:53 +0200 Subject: Add autowaf.add_flags() for terse flag definition --- waflib/extras/autowaf.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'waflib') diff --git a/waflib/extras/autowaf.py b/waflib/extras/autowaf.py index 243ab05..57c0242 100644 --- a/waflib/extras/autowaf.py +++ b/waflib/extras/autowaf.py @@ -93,6 +93,11 @@ def set_options(opt, debug_by_default=False, test=False): g_step = 1 +def add_flags(opt, flags): + for name, desc in flags.items(): + opt.add_option('--' + name, action='store_true', + dest=name.replace('-', '_'), help=desc) + def get_check_func(conf, lang): if lang == 'c': return conf.check_cc -- cgit v1.2.1