waf: added --extra-hwdef option

This commit is contained in:
willpiper 2021-06-18 18:05:43 +01:00 committed by Andrew Tridgell
parent fb4a4e609a
commit 15cd9d502d
2 changed files with 9 additions and 0 deletions

View File

@ -383,6 +383,8 @@ def generate_hwdef_h(env):
os.mkdir(hwdef_out) os.mkdir(hwdef_out)
python = sys.executable 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) 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) return subprocess.call(cmd, shell=True)
def pre_build(bld): def pre_build(bld):

View File

@ -262,6 +262,11 @@ configuration in order to save typing.
default=False, default=False,
help='force single precision postype_t') 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): def _collect_autoconfig_files(cfg):
for m in sys.modules.values(): for m in sys.modules.values():
paths = [] paths = []
@ -308,6 +313,8 @@ def configure(cfg):
cfg.env.ENABLE_MALLOC_GUARD = cfg.options.enable_malloc_guard cfg.env.ENABLE_MALLOC_GUARD = cfg.options.enable_malloc_guard
cfg.env.ENABLE_STATS = cfg.options.enable_stats cfg.env.ENABLE_STATS = cfg.options.enable_stats
cfg.env.HWDEF_EXTRA = cfg.options.extra_hwdef
cfg.env.OPTIONS = cfg.options.__dict__ cfg.env.OPTIONS = cfg.options.__dict__
# Allow to differentiate our build from the make build # Allow to differentiate our build from the make build