diff --git a/Tools/ardupilotwaf/boards.py b/Tools/ardupilotwaf/boards.py index bb683a0614..9995b92055 100644 --- a/Tools/ardupilotwaf/boards.py +++ b/Tools/ardupilotwaf/boards.py @@ -578,6 +578,9 @@ def get_boards_names(): return sorted(list(_board_classes.keys()), key=str.lower) +def is_board_based(board, cls): + return issubclass(_board_classes[board], cls) + def get_ap_periph_boards(): '''Add AP_Periph boards based on existance of periph keywork in hwdef.dat or board name''' list_ap = [s for s in list(_board_classes.keys()) if "periph" in s] diff --git a/wscript b/wscript index 61fffcb8be..5127c1b2df 100644 --- a/wscript +++ b/wscript @@ -674,9 +674,9 @@ def generate_tasklist(ctx, do_print=True): elif 'iofirmware' in board: task['targets'] = ['iofirmware', 'bootloader'] else: - if 'sitl' in board or 'SITL' in board: + if boards.is_board_based(board, boards.sitl): task['targets'] = ['antennatracker', 'copter', 'heli', 'plane', 'rover', 'sub', 'replay'] - elif 'linux' in board: + elif boards.is_board_based(board, boards.linux): task['targets'] = ['antennatracker', 'copter', 'heli', 'plane', 'rover', 'sub'] else: task['targets'] = ['antennatracker', 'copter', 'heli', 'plane', 'rover', 'sub', 'bootloader']