scripts: gen_dts_cmake: emit properties for /aliases

This enables cmake extensions that can look up the path for any
devicetree alias, or check if the alias is missing, etc.

Signed-off-by: Martí Bolívar <marti.bolivar@nordicsemi.no>
This commit is contained in:
Martí Bolívar 2021-11-19 12:34:56 -08:00 committed by Christopher Friedt
parent b65b49bef6
commit 17ae4fe05a
1 changed files with 7 additions and 0 deletions

View File

@ -88,6 +88,13 @@ def main():
path = chosen_nodes[node].path
cmake_props.append(f'"DT_CHOSEN|{node}" "{path}"')
# The separate loop over edt.nodes here is meant to keep
# all of the alias-related properties in one place.
for node in edt.nodes:
path = node.path
for alias in node.aliases:
cmake_props.append(f'"DT_ALIAS|{alias}" "{path}"')
for node in edt.nodes:
cmake_props.append(f'"DT_NODE|{node.path}" TRUE')