From 15cd9d502d2bb654e11de2a77656eaeae179794e Mon Sep 17 00:00:00 2001 From: willpiper Date: Fri, 18 Jun 2021 18:05:43 +0100 Subject: [PATCH] waf: added --extra-hwdef option --- Tools/ardupilotwaf/chibios.py | 2 ++ wscript | 7 +++++++ 2 files changed, 9 insertions(+) diff --git a/Tools/ardupilotwaf/chibios.py b/Tools/ardupilotwaf/chibios.py index 36d3dfbb55..811da44ff7 100644 --- a/Tools/ardupilotwaf/chibios.py +++ b/Tools/ardupilotwaf/chibios.py @@ -383,6 +383,8 @@ def generate_hwdef_h(env): os.mkdir(hwdef_out) python = sys.executable cmd = "{0} '{1}' -D '{2}' '{3}' {4} --params '{5}'".format(python, hwdef_script, hwdef_out, env.HWDEF, env.BOOTLOADER_OPTION, env.DEFAULT_PARAMETERS) + if env.HWDEF_EXTRA: + cmd += " --extra-hwdef '{0}'".format(env.HWDEF_EXTRA) return subprocess.call(cmd, shell=True) def pre_build(bld): diff --git a/wscript b/wscript index 98560fbbf0..790052f8fd 100644 --- a/wscript +++ b/wscript @@ -262,6 +262,11 @@ configuration in order to save typing. default=False, help='force single precision postype_t') + g.add_option('--extra-hwdef', + action='store', + default=None, + help='Extra hwdef.dat file for custom build.') + def _collect_autoconfig_files(cfg): for m in sys.modules.values(): paths = [] @@ -308,6 +313,8 @@ def configure(cfg): cfg.env.ENABLE_MALLOC_GUARD = cfg.options.enable_malloc_guard cfg.env.ENABLE_STATS = cfg.options.enable_stats + cfg.env.HWDEF_EXTRA = cfg.options.extra_hwdef + cfg.env.OPTIONS = cfg.options.__dict__ # Allow to differentiate our build from the make build