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((HWMv1 AND NOT EXISTS ${BOARD_DIR}/${BOARD}_defconfig)
145 OR (HWMv2 AND NOT EXISTS ${BOARD_DIR}/board.yml))
153 # This command is used for locating the board dir as well as printing all boards
155 # - User specifies an invalid BOARD
158 list(TRANSFORM BOARD_ROOT PREPEND "--board-root=" OUTPUT_VARIABLE board_root_args)
169 execute_process(${list_boards_commands} --board=${BOARD_ALIAS} --cmakeformat={DIR}
179 message("Board alias ${BOARD_ALIAS} is hiding the real board of same name")
188 list(TRANSFORM BOARD_DIRECTORIES PREPEND "--board-dir=" OUTPUT_VARIABLE board_dir_arg)
189 execute_process(${list_boards_commands} --board=${BOARD} ${board_dir_arg}
196 message(FATAL_ERROR "Error finding board: ${BOARD}\nError message: ${err_board}")
205 set(BOARD_DIR ${BOARD_DIR} CACHE PATH "Main board directory for board (${BOARD})" FORCE)
206 …ARD_DIRECTORIES ${LIST_BOARD_DIR} CACHE INTERNAL "List of board directories for board (${BOARD})" …
208 set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${dir}/board.yml)
218 message(FATAL_ERROR "Error finding board: ${BOARD} in ${BOARD_DIR}.\n"
219 "This indicates the board has been removed, renamed, or placed at a new location.\n"
223 message("No board named '${BOARD}' found.\n\n"
228 message(FATAL_ERROR "Invalid BOARD; see above.")
233 "Board '${BOARD}' does not support board qualifiers, ${BOARD}${BOARD_QUALIFIERS}.\n"
234 "Please specify board without qualifiers.\n"
245 # Board provides revision handling.
248 message(WARNING "Board revision ${BOARD_REVISION} specified for ${BOARD}, \
249 but board has no revision so revision will be ignored.")
277 "revision.cmake is not used, revisions must be defined in '${BOARD_DIR}/board.yml'"
281 message(FATAL_ERROR "Invalid board revision: ${BOARD_REVISION}\n"
282 "Board '${BOARD}' does not define any revisions."
287 # Allow users to omit the SoC when building for a board with a single SoC.
291 set(BOARD_${BOARD}_SINGLE_SOC TRUE)
300 list(TRANSFORM board_targets PREPEND "${BOARD}/")
301 if(NOT ("${BOARD}${BOARD_QUALIFIERS}" IN_LIST board_targets))
304 message(FATAL_ERROR "Board qualifiers `${BOARD_QUALIFIERS}` for board \
305 `${BOARD}` not found. Please specify a valid board target.\n"
306 "Valid board targets for ${LIST_BOARD_NAME} are:\n${board_targets}\n")
310 message(FATAL_ERROR "Unknown hw model (${HWM}) for board: ${BOARD}.")
313 set(board_message "Board: ${BOARD}")
332 set(NORMALIZED_BOARD_TARGET "${BOARD}${BOARD_QUALIFIERS}")
339 # Board extensions are enabled by default
340 set(BOARD_EXTENSIONS ON CACHE BOOL "Support board extensions")
343 # Process board extensions
356 build_info(board name VALUE ${BOARD})
358 build_info(board qualifiers VALUE ${qualifiers})
359 build_info(board revision VALUE ${BOARD_REVISION})