Skip to content

Commit

Permalink
boards: kconfig: Add BOARD_QUALIFIERS and BOARD_TARGET
Browse files Browse the repository at this point in the history
Adds the user-provided board qualifiers to Kconfig so it can be
used by application code, along with one containing the full string

Signed-off-by: Jamie McCrae <[email protected]>
  • Loading branch information
nordicjm authored and carlescufi committed Mar 21, 2024
1 parent a430294 commit efdd9d4
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
11 changes: 11 additions & 0 deletions boards/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,17 @@ config BOARD_REVISION
"plank@foo", this option will be "foo". If BOARD is "plank",
this option will be the empty string.

config BOARD_TARGET
string
default "$(BOARD)@$(BOARD_REVISION)$(BOARD_QUALIFIERS)" if "$(BOARD_REVISION)" != ""
default "$(BOARD)$(BOARD_QUALIFIERS)"
help
Contains the board target (full string including name, revision, soc, cluster and
variant) of the board being used.

For example, if building for ``nrf5340dk/nrf5340/cpuapp`` then this will contain the
value ``nrf5340dk/nrf5340/cpuapp``.

config BOARD_DEPRECATED_RELEASE
string
help
Expand Down
12 changes: 11 additions & 1 deletion boards/Kconfig.v2
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
# Copyright (c) 2022 Nordic Semiconductor ASA
# Copyright (c) 2022-2024 Nordic Semiconductor ASA

# SPDX-License-Identifier: Apache-2.0

BOARD_STRING := $(normalize_upper,$(BOARD))
BOARD_TARGET_STRING := $(normalize_upper,$(BOARD)$(BOARD_QUALIFIERS))
BOARD_QUALIFIERS_NO_SEPARATOR := $(substring,$(BOARD_QUALIFIERS),1)

config BOARD_$(BOARD_STRING)
def_bool y
Expand All @@ -15,4 +16,13 @@ config BOARD_$(BOARD_TARGET_STRING)
help
Kconfig symbol identifying the board target.

config BOARD_QUALIFIERS
string
default "$(BOARD_QUALIFIERS_NO_SEPARATOR)"
help
Contains the qualifiers of the board being used without the name of the board itself.

For example, if building for ``nrf5340dk/nrf5340/cpuapp`` then this will contain the
value ``nrf5340/cpuapp``.

osource "$(BOARD_DIR)/Kconfig.$(BOARD)"

0 comments on commit efdd9d4

Please sign in to comment.