Lines Matching full:board
5 # Validate board and setup boards target.
7 # This CMake module will validate the BOARD argument as well as splitting the
8 # BOARD argument into <BOARD> and <BOARD_REVISION>. When BOARD_EXTENSIONS option
9 # is enabled (default) this module will also take care of finding board
12 # If a board implementation is not found for the specified board an error will
15 # If user provided board is a board alias, the board will be adjusted to real
16 # board name.
18 # If board name is deprecated, then board will be adjusted to new board name and
24 # - BOARD: Board, without revision field.
25 # - BOARD_REVISION: Board revision
26 # - BOARD_QUALIFIERS: Board qualifiers
27 # - NORMALIZED_BOARD_QUALIFIERS: Board qualifiers in lower-case format where slashes have been
29 # - NORMALIZED_BOARD_TARGET: Board target in lower-case format where slashes have been
31 # - BOARD_DIR: Board directory with the implementation for selected board
32 # - ARCH_DIR: Arch dir for extracted from selected board
34 # - BOARD_EXTENSION_DIRS: List of board extension directories (If
38 # - board: when invoked, a list of valid boards will be printed
41 # - BOARD: Board name, including any optional revision field, for example: `foo` or `foo@1.0.0`
44 # - BOARD_ROOT: CMake list of board roots containing board implementations
49 # containing board aliases.
59 # Check that BOARD has been provided, and that it has not changed.
60 # If user tries to change the BOARD, the BOARD value is reset to the BOARD_CACHED value.
61 zephyr_check_cache(BOARD REQUIRED)
69 # Helper function for parsing a board's name, revision, and qualifiers,
75 "Valid format is: <board>@<revision>/<qualifiers>"
86 BOARD
87 BOARD BOARD_REVISION BOARD_QUALIFIERS
93 if(${BOARD}_BOARD_ALIAS)
94 set(BOARD_ALIAS ${BOARD} CACHE STRING "Board alias, provided by user")
96 ${BOARD}_BOARD_ALIAS
97 BOARD BOARD_ALIAS_REVISION BOARD_ALIAS_QUALIFIERS
99 message(STATUS "Aliased BOARD=${BOARD_ALIAS} changed to ${BOARD}")
108 if(${BOARD}${BOARD_QUALIFIERS}_DEPRECATED)
109 …set(BOARD_DEPRECATED ${BOARD}${BOARD_QUALIFIERS} CACHE STRING "Deprecated BOARD, provided by user")
111 "Deprecated BOARD=${BOARD_DEPRECATED} specified, "
112 "board automatically changed to: ${${BOARD}${BOARD_QUALIFIERS}_DEPRECATED}."
115 ${BOARD}${BOARD_QUALIFIERS}_DEPRECATED
116 BOARD BOARD_DEPRECATED_REVISION BOARD_QUALIFIERS
121 "Invalid board revision: ${BOARD_REVISION}\n"
122 "Deprecated board '${BOARD_DEPRECATED}' is now implemented as a revision of another board "
123 "(${BOARD}@${BOARD_DEPRECATED_REVISION}), so the specified revision does not apply. "
124 "Please consult the documentation for '${BOARD}' to see how to build for the new board."
131 zephyr_boilerplate_watch(BOARD)
134 # Check that the board root looks reasonable.
139 …- if your board directory is '/foo/bar/boards/my_board' then add '/foo/bar' to BOARD_ROOT, not the…
144 if(HWMv2 AND NOT EXISTS ${BOARD_DIR}/board.yml)
152 # This command is used for locating the board dir as well as printing all boards
154 # - User specifies an invalid BOARD
157 list(TRANSFORM BOARD_ROOT PREPEND "--board-root=" OUTPUT_VARIABLE board_root_args)
168 execute_process(${list_boards_commands} --board=${BOARD_ALIAS} --cmakeformat={DIR}
178 message("Board alias ${BOARD_ALIAS} is hiding the real board of same name")
187 list(TRANSFORM BOARD_DIRECTORIES PREPEND "--board-dir=" OUTPUT_VARIABLE board_dir_arg)
188 execute_process(${list_boards_commands} --board=${BOARD} ${board_dir_arg}
195 message(FATAL_ERROR "Error finding board: ${BOARD}\nError message: ${err_board}")
204 set(BOARD_DIR ${BOARD_DIR} CACHE PATH "Main board directory for board (${BOARD})" FORCE)
205 …ARD_DIRECTORIES ${LIST_BOARD_DIR} CACHE INTERNAL "List of board directories for board (${BOARD})" …
207 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/board.yml)
216 message(FATAL_ERROR "Error finding board: ${BOARD} in ${BOARD_DIR}.\n"
217 "This indicates the board has been removed, renamed, or placed at a new location.\n"
221 message("No board named '${BOARD}' found.\n\n"
226 message(FATAL_ERROR "Invalid BOARD; see above.")
259 "revision.cmake is not used, revisions must be defined in '${BOARD_DIR}/board.yml'"
263 message(FATAL_ERROR "Invalid board revision: ${BOARD_REVISION}\n"
264 "Board '${BOARD}' does not define any revisions."
269 # Allow users to omit the SoC when building for a board with a single SoC.
273 set(BOARD_${BOARD}_SINGLE_SOC TRUE)
282 list(TRANSFORM board_targets PREPEND "${BOARD}/")
283 if(NOT ("${BOARD}${BOARD_QUALIFIERS}" IN_LIST board_targets))
286 message(FATAL_ERROR "Board qualifiers `${BOARD_QUALIFIERS}` for board \
287 `${BOARD}` not found. Please specify a valid board target.\n"
288 "Valid board targets for ${LIST_BOARD_NAME} are:\n${board_targets}\n")
292 set(board_message "Board: ${BOARD}")
311 set(NORMALIZED_BOARD_TARGET "${BOARD}${BOARD_QUALIFIERS}")
318 # Board extensions are enabled by default
319 set(BOARD_EXTENSIONS ON CACHE BOOL "Support board extensions")
322 # Process board extensions
335 build_info(board name VALUE ${BOARD})
337 build_info(board qualifiers VALUE ${qualifiers})
338 build_info(board revision VALUE ${BOARD_REVISION})
339 build_info(board path PATH ${BOARD_DIRECTORIES})