cmake: cache BOARD_IDENTIFIER to preserve it between CMake invocations

A CMake rerun would not extract or determine the BOARD_IDENTIFIER
correctly because `list_boards.py` is only invoked for first CMake
invocation.

Therefore cache the BOARD_IDENTIFIER so that it's preserved between
CMake re-runs.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
Torsten Rasmussen 2024-01-10 12:24:30 +01:00 committed by Jamie McCrae
parent 85dddac5a2
commit 7db2b6efd8
1 changed files with 1 additions and 0 deletions

View File

@ -234,6 +234,7 @@ elseif(HWMv2)
`${BOARD}` not found. Please specify a valid board.\n"
"Valid board identifiers for ${BOARD_NAME} are:\n${BOARD_IDENTIFIERS}\n")
endif()
set(BOARD_IDENTIFIER ${BOARD_IDENTIFIER} CACHE INTERNAL "Board identifier")
endif()
else()
message(FATAL_ERROR "Unknown hw model (${HWM}) for board: ${BOARD}.")