From 8c4d4f3f2a8e450479ae08de833f087cfa67b0d7 Mon Sep 17 00:00:00 2001 From: Gustavo Jose de Sousa Date: Wed, 17 Feb 2016 12:48:08 +0000 Subject: [PATCH] waf: make options groups accessible for any tool That allows options being declared where they're really used. Additionally, we load ardupilotwaf after the other tools so that we can create our groups after all non-ardupilot option groups are created. That makes our groups appear as the last ones in the help message, which makes it easier to locate them. --- Tools/ardupilotwaf/ardupilotwaf.py | 2 +- wscript | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/Tools/ardupilotwaf/ardupilotwaf.py b/Tools/ardupilotwaf/ardupilotwaf.py index 8749e59b98..e19b48f23b 100644 --- a/Tools/ardupilotwaf/ardupilotwaf.py +++ b/Tools/ardupilotwaf/ardupilotwaf.py @@ -307,7 +307,7 @@ def _select_programs_from_group(bld): bld.targets += ',' + tg.name def options(opt): - g = opt.add_option_group('Ardupilot build options') + g = opt.ap_groups['build'] g.add_option('--program-group', action='append', default=[], diff --git a/wscript b/wscript index 3863d84682..b9dea106db 100644 --- a/wscript +++ b/wscript @@ -39,10 +39,17 @@ def init(ctx): c.variant = env.BOARD def options(opt): - opt.load('ardupilotwaf') opt.load('compiler_cxx compiler_c waf_unit_test python') - g = opt.add_option_group('Ardupilot configure options') + opt.ap_groups = { + 'configure': opt.add_option_group('Ardupilot configure options'), + 'build': opt.add_option_group('Ardupilot build options'), + 'check': opt.add_option_group('Ardupilot check options'), + } + + opt.load('ardupilotwaf') + + g = opt.ap_groups['configure'] boards_names = boards.get_boards_names() g.add_option('--board', action='store', @@ -50,7 +57,7 @@ def options(opt): default='sitl', help='Target board to build, choices are %s' % boards_names) - g = opt.add_option_group('Ardupilot check options') + g = opt.ap_groups['check'] g.add_option('--check-verbose', action='store_true', help='Output all test programs')