diff --git a/scripts/west_commands/boards.py b/scripts/west_commands/boards.py index 1c4b77d38ce9b3..1434b6ff3429fc 100644 --- a/scripts/west_commands/boards.py +++ b/scripts/west_commands/boards.py @@ -73,16 +73,21 @@ def do_run(self, args, _): else: name_re = None - args.arch_roots = [ZEPHYR_BASE] - args.soc_roots = [ZEPHYR_BASE] - modules_board_roots = [ZEPHYR_BASE] + module_settings = { + 'arch_root': [ZEPHYR_BASE], + 'board_root': [ZEPHYR_BASE], + 'soc_root': [ZEPHYR_BASE], + } for module in zephyr_module.parse_modules(ZEPHYR_BASE, self.manifest): - board_root = module.meta.get('build', {}).get('settings', {}).get('board_root') - if board_root is not None: - modules_board_roots.append(Path(module.project) / board_root) - - args.board_roots += modules_board_roots + for key in module_settings: + root = module.meta.get('build', {}).get('settings', {}).get(key) + if root is not None: + module_settings[key].append(Path(module.project) / root) + + args.arch_roots += module_settings['arch_root'] + args.board_roots += module_settings['board_root'] + args.soc_roots += module_settings['soc_root'] for board in list_boards.find_boards(args): if name_re is not None and not name_re.search(board.name):