cmake: Show usage when an invalid board is given
Print the usage when an invalid board is given, this somewhat allievates the catch-22 where you need to run CMake to know what boards exist, but you need a board to run CMake. Signed-off-by: Sebastian Bøe <sebastian.boe@nordicsemi.no>
This commit is contained in:
parent
6c8ebab183
commit
b0c4316190
1 changed files with 2 additions and 1 deletions
|
@ -155,7 +155,8 @@ set(CACHED_BOARD ${BOARD} CACHE STRING "Selected board")
|
|||
# e.g. zephyr/boards/arm/96b_carbon_nrf51/96b_carbon_nrf51_defconfig. When
|
||||
# found, use that path to infer the ARCH we are building for.
|
||||
find_path(BOARD_DIR NAMES "${BOARD}_defconfig" PATHS $ENV{ZEPHYR_BASE}/boards/*/* NO_DEFAULT_PATH)
|
||||
assert(BOARD_DIR "No board named '${BOARD}' found")
|
||||
|
||||
assert_with_usage(BOARD_DIR "No board named '${BOARD}' found")
|
||||
|
||||
get_filename_component(BOARD_ARCH_DIR ${BOARD_DIR} DIRECTORY)
|
||||
get_filename_component(ARCH ${BOARD_ARCH_DIR} NAME)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue