mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-05 15:33:57 -04:00
waf: process board and project configuration before toolchain
Several boards require cross compilation. The objective of this change is to allow to specify the target architecture in the board definition, so that the correct toolchain is selected. The cross compilation mechanism will be implemented in the next commits.
This commit is contained in:
parent
82a33399ef
commit
7aa43d36d2
32
wscript
32
wscript
@ -58,6 +58,22 @@ def configure(cfg):
|
|||||||
# use a different variant for each board
|
# use a different variant for each board
|
||||||
cfg.setenv(cfg.env.BOARD)
|
cfg.setenv(cfg.env.BOARD)
|
||||||
|
|
||||||
|
cfg.msg('Setting board to', cfg.options.board)
|
||||||
|
cfg.env.BOARD = cfg.options.board
|
||||||
|
board_dict = boards.BOARDS[cfg.env.BOARD].get_merged_dict()
|
||||||
|
|
||||||
|
# Always prepend so that arguments passed in the command line get
|
||||||
|
# the priority.
|
||||||
|
for k in board_dict:
|
||||||
|
val = board_dict[k]
|
||||||
|
# Dictionaries (like 'DEFINES') are converted to lists to
|
||||||
|
# conform to waf conventions.
|
||||||
|
if isinstance(val, dict):
|
||||||
|
for item in val.items():
|
||||||
|
cfg.env.prepend_value(k, '%s=%s' % item)
|
||||||
|
else:
|
||||||
|
cfg.env.prepend_value(k, val)
|
||||||
|
|
||||||
cfg.load('compiler_cxx compiler_c')
|
cfg.load('compiler_cxx compiler_c')
|
||||||
cfg.load('clang_compilation_database')
|
cfg.load('clang_compilation_database')
|
||||||
cfg.load('waf_unit_test')
|
cfg.load('waf_unit_test')
|
||||||
@ -76,22 +92,6 @@ def configure(cfg):
|
|||||||
errmsg='not found, unit tests disabled',
|
errmsg='not found, unit tests disabled',
|
||||||
)
|
)
|
||||||
|
|
||||||
cfg.msg('Setting board to', cfg.options.board)
|
|
||||||
cfg.env.BOARD = cfg.options.board
|
|
||||||
board_dict = boards.BOARDS[cfg.env.BOARD].get_merged_dict()
|
|
||||||
|
|
||||||
# Always prepend so that arguments passed in the command line get
|
|
||||||
# the priority.
|
|
||||||
for k in board_dict:
|
|
||||||
val = board_dict[k]
|
|
||||||
# Dictionaries (like 'DEFINES') are converted to lists to
|
|
||||||
# conform to waf conventions.
|
|
||||||
if isinstance(val, dict):
|
|
||||||
for item in val.items():
|
|
||||||
cfg.env.prepend_value(k, '%s=%s' % item)
|
|
||||||
else:
|
|
||||||
cfg.env.prepend_value(k, val)
|
|
||||||
|
|
||||||
cfg.env.prepend_value('INCLUDES', [
|
cfg.env.prepend_value('INCLUDES', [
|
||||||
cfg.srcnode.abspath() + '/libraries/'
|
cfg.srcnode.abspath() + '/libraries/'
|
||||||
])
|
])
|
||||||
|
Loading…
Reference in New Issue
Block a user