waf: factor out a vehicles array

most elements duplicated for sitl, linux and ChibiOS
This commit is contained in:
Peter Barker 2024-04-16 21:27:54 +10:00 committed by Andrew Tridgell
parent 7d10b0fc4d
commit 7f1a551364
1 changed files with 6 additions and 4 deletions

10
wscript
View File

@ -657,6 +657,8 @@ def list_ap_periph_boards(ctx):
def ap_periph_boards(ctx): def ap_periph_boards(ctx):
return boards.get_ap_periph_boards() return boards.get_ap_periph_boards()
vehicles = ['antennatracker', 'blimp', 'copter', 'heli', 'plane', 'rover', 'sub']
def generate_tasklist(ctx, do_print=True): def generate_tasklist(ctx, do_print=True):
boardlist = boards.get_boards_names() boardlist = boards.get_boards_names()
ap_periph_targets = boards.get_ap_periph_boards() ap_periph_targets = boards.get_ap_periph_boards()
@ -675,11 +677,11 @@ def generate_tasklist(ctx, do_print=True):
task['targets'] = ['iofirmware', 'bootloader'] task['targets'] = ['iofirmware', 'bootloader']
else: else:
if boards.is_board_based(board, boards.sitl): if boards.is_board_based(board, boards.sitl):
task['targets'] = ['antennatracker', 'copter', 'heli', 'plane', 'rover', 'sub', 'replay'] task['targets'] = vehicles + ['replay']
elif boards.is_board_based(board, boards.linux): elif boards.is_board_based(board, boards.linux):
task['targets'] = ['antennatracker', 'copter', 'heli', 'plane', 'rover', 'sub'] task['targets'] = vehicles
else: else:
task['targets'] = ['antennatracker', 'copter', 'heli', 'plane', 'rover', 'sub', 'bootloader'] task['targets'] = vehicles + ['bootloader']
task['buildOptions'] = '--upload' task['buildOptions'] = '--upload'
tasks.append(task) tasks.append(task)
tlist.write(json.dumps(tasks)) tlist.write(json.dumps(tasks))
@ -901,7 +903,7 @@ ardupilotwaf.build_command('check-all',
doc='shortcut for `waf check --alltests`', doc='shortcut for `waf check --alltests`',
) )
for name in ('antennatracker', 'copter', 'heli', 'plane', 'rover', 'sub', 'blimp', 'bootloader','iofirmware','AP_Periph','replay'): for name in (vehicles + ['bootloader','iofirmware','AP_Periph','replay']):
ardupilotwaf.build_command(name, ardupilotwaf.build_command(name,
program_group_list=name, program_group_list=name,
doc='builds %s programs' % name, doc='builds %s programs' % name,