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>
This commit is contained in:
committed by
Jamie McCrae
parent
65f5dc5b8c
commit
87147f88c4
@@ -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))
|
||||||
string(SUBSTRING ${BOARD} ${IDENTIFIER_SEPARATOR_INDEX} -1 BOARD_IDENTIFIER)
|
if(NOT DEFINED CACHE{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()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user