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:
Gustavo Jose de Sousa 2015-11-25 13:48:45 -02:00 committed by Lucas De Marchi
parent 82a33399ef
commit 7aa43d36d2

32
wscript
View File

@ -58,6 +58,22 @@ def configure(cfg):
# use a different variant for each 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('clang_compilation_database')
cfg.load('waf_unit_test')
@ -76,22 +92,6 @@ def configure(cfg):
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.srcnode.abspath() + '/libraries/'
])