Browse Source

cmake: prefer cache BOARD_IDENTIFIER over extracting from BOARD

The BOARD_IDENTIFIER is extracted from the BOARD argument provided by
the user.

Thereafter the BOARD_IDENTIFIER is compared to the list of valid board
identifiers returned by list_boards.py, and expanded with optional
fields as required.

Thereafter the expanded and full BOARD_IDENTIFIER is place as internal
variable in the CMake cache.

This means subsequent CMake invocations should use the expanded
BOARD_IDENTIFIER from the CMake cache instead of extracting it from the
BOARD variable.

Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
pull/69687/head
Torsten Rasmussen 1 year ago committed by Jamie McCrae
parent
commit
87147f88c4
  1. 2
      cmake/modules/boards.cmake

2
cmake/modules/boards.cmake

@ -73,7 +73,9 @@ if(NOT (REVISION_SEPARATOR_INDEX EQUAL -1 OR IDENTIFIER_SEPARATOR_INDEX EQUAL -1
endif() endif()
if(NOT (IDENTIFIER_SEPARATOR_INDEX EQUAL -1)) if(NOT (IDENTIFIER_SEPARATOR_INDEX EQUAL -1))
if(NOT DEFINED CACHE{BOARD_IDENTIFIER})
string(SUBSTRING ${BOARD} ${IDENTIFIER_SEPARATOR_INDEX} -1 BOARD_IDENTIFIER) string(SUBSTRING ${BOARD} ${IDENTIFIER_SEPARATOR_INDEX} -1 BOARD_IDENTIFIER)
endif()
string(SUBSTRING ${BOARD} 0 ${IDENTIFIER_SEPARATOR_INDEX} BOARD) string(SUBSTRING ${BOARD} 0 ${IDENTIFIER_SEPARATOR_INDEX} BOARD)
endif() endif()

Loading…
Cancel
Save