scripts: gen_defines: allow multiple --vendor-prefixes
Allowing multiple such files will let higher layers take inputs from multiple DTS_ROOT directories. This in turn will allow out of tree bindings to manage their own sets of prefixes without patching upstream Zephyr's file or doing other similar hacks. Parse each file into a dict, and merge those dicts into a single dictionary for the EDT constructor. Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
parent
2533246610
commit
85837e1c54
1 changed files with 6 additions and 6 deletions
|
@ -57,10 +57,9 @@ def main():
|
||||||
|
|
||||||
setup_edtlib_logging()
|
setup_edtlib_logging()
|
||||||
|
|
||||||
if args.vendor_prefixes:
|
vendor_prefixes = {}
|
||||||
vendor_prefixes = edtlib.load_vendor_prefixes_txt(args.vendor_prefixes)
|
for prefixes_file in args.vendor_prefixes:
|
||||||
else:
|
vendor_prefixes.update(edtlib.load_vendor_prefixes_txt(prefixes_file))
|
||||||
vendor_prefixes = None
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
edt = edtlib.EDT(args.dts, args.bindings_dirs,
|
edt = edtlib.EDT(args.dts, args.bindings_dirs,
|
||||||
|
@ -214,8 +213,9 @@ def parse_args():
|
||||||
help="path to write device struct extern header to")
|
help="path to write device struct extern header to")
|
||||||
parser.add_argument("--edt-pickle-out",
|
parser.add_argument("--edt-pickle-out",
|
||||||
help="path to write pickled edtlib.EDT object to")
|
help="path to write pickled edtlib.EDT object to")
|
||||||
parser.add_argument("--vendor-prefixes",
|
parser.add_argument("--vendor-prefixes", action='append', default=[],
|
||||||
help="vendor-prefixes.txt path; used for validation")
|
help="vendor-prefixes.txt path; used for validation; "
|
||||||
|
"may be given multiple times")
|
||||||
parser.add_argument("--edtlib-Werror", action="store_true",
|
parser.add_argument("--edtlib-Werror", action="store_true",
|
||||||
help="if set, edtlib-specific warnings become errors. "
|
help="if set, edtlib-specific warnings become errors. "
|
||||||
"(this does not apply to warnings shared "
|
"(this does not apply to warnings shared "
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue