Skip to content

Commit

Permalink
cmake: clear BOARD_CACHE when invalid board identifier is given
Browse files Browse the repository at this point in the history
Clear BOARD_CACHE when no or an invalid board identifier is provided
on first CMake invocation.

This allows users to re-run CMake and provide a valid board identifier
as well as avoiding `BOARD` to be replaced with an invalid BOARD_CACHED
value.

Signed-off-by: Torsten Rasmussen <[email protected]>
  • Loading branch information
tejlmand committed Jan 19, 2024
1 parent c2a905e commit d7d3a97
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cmake/modules/boards.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ elseif(HWMv2)

if(NOT ("${BOARD}${BOARD_IDENTIFIER}" IN_LIST BOARD_IDENTIFIERS))
string(REPLACE ";" "\n" BOARD_IDENTIFIERS "${BOARD_IDENTIFIERS}")
unset(CACHED_BOARD CACHE)
message(FATAL_ERROR "Board identifier `${BOARD_IDENTIFIER}` for board \
`${BOARD}` not found. Please specify a valid board.\n"
"Valid board identifiers for ${BOARD_NAME} are:\n${BOARD_IDENTIFIERS}\n")
Expand Down

0 comments on commit d7d3a97

Please sign in to comment.