waf: make board name case insensitive in waf configure

This commit is contained in:
Andrew Tridgell 2019-03-04 11:18:15 +11:00
parent 8d4215fd82
commit 102141756a
2 changed files with 9 additions and 1 deletions

View File

@ -294,6 +294,15 @@ Please use a replacement build as follows:
px4-v4pro Use DrotekP3Pro build px4-v4pro Use DrotekP3Pro build
''' % ctx.env.BOARD) ''' % ctx.env.BOARD)
boards = _board_classes.keys()
if not ctx.env.BOARD in boards:
# try case-insensitive match
for b in boards:
if b.upper() == ctx.env.BOARD.upper():
ctx.env.BOARD = b
break
if not ctx.env.BOARD in boards:
ctx.fatal("Invalid board '%s': choices are %s" % (ctx.env.BOARD, ', '.join(boards)))
_board = _board_classes[ctx.env.BOARD]() _board = _board_classes[ctx.env.BOARD]()
return _board return _board

View File

@ -68,7 +68,6 @@ def options(opt):
removed_names = boards.get_removed_boards() removed_names = boards.get_removed_boards()
g.add_option('--board', g.add_option('--board',
action='store', action='store',
choices=boards_names + removed_names,
default=None, default=None,
help='Target board to build, choices are %s.' % ', '.join(boards_names)) help='Target board to build, choices are %s.' % ', '.join(boards_names))