waf: Fail if custom hwdef file doesn't exist

Signed-off-by: Ryan Friedman <25047695+Ryanf55@users.noreply.github.com>
This commit is contained in:
Ryan Friedman 2024-10-23 18:01:57 +09:00 committed by Peter Barker
parent b4df082618
commit 0725109d1c
1 changed files with 3 additions and 0 deletions

View File

@ -506,6 +506,9 @@ def configure(cfg):
cfg.env.ENABLE_STATS = cfg.options.enable_stats cfg.env.ENABLE_STATS = cfg.options.enable_stats
cfg.env.SAVE_TEMPS = cfg.options.save_temps cfg.env.SAVE_TEMPS = cfg.options.save_temps
extra_hwdef = cfg.options.extra_hwdef
if extra_hwdef is not None and not os.path.exists(extra_hwdef):
raise FileNotFoundError(f"extra-hwdef file NOT found: '{cfg.options.extra_hwdef}'")
cfg.env.HWDEF_EXTRA = cfg.options.extra_hwdef cfg.env.HWDEF_EXTRA = cfg.options.extra_hwdef
if cfg.env.HWDEF_EXTRA: if cfg.env.HWDEF_EXTRA:
cfg.env.HWDEF_EXTRA = os.path.abspath(cfg.env.HWDEF_EXTRA) cfg.env.HWDEF_EXTRA = os.path.abspath(cfg.env.HWDEF_EXTRA)