From 7aa43d36d2e7e860940ef30181ea6e6c19c6b518 Mon Sep 17 00:00:00 2001 From: Gustavo Jose de Sousa Date: Wed, 25 Nov 2015 13:48:45 -0200 Subject: [PATCH] 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. --- wscript | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/wscript b/wscript index b73e8d5a39..784d9e171b 100644 --- a/wscript +++ b/wscript @@ -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/' ])