kconfig/cmake: Check that one of the CONFIG_<arch> symbols is set
All SoCs must now 'select' one of the CONFIG_<arch> symbols. Add an ARCH_IS_SET helper symbol that's selected by the arch symbols and checked in CMake, printing a warning otherwise. Might save people some time until they're used to the new scheme. Signed-off-by: Ulf Magnusson <Ulf.Magnusson@nordicsemi.no>
This commit is contained in:
parent
c5839f834b
commit
de42aea18f
2 changed files with 20 additions and 0 deletions
|
@ -142,6 +142,13 @@ else()
|
|||
assert(0 "Unreachable code. Expected optimization level to have been chosen. See Kconfig.zephyr")
|
||||
endif()
|
||||
|
||||
if(NOT CONFIG_ARCH_IS_SET)
|
||||
message(WARNING "\
|
||||
None of the CONFIG_<arch> (e.g. CONFIG_X86) symbols are set. \
|
||||
Select one of them from the SOC_SERIES_* symbol or, lacking that, from the \
|
||||
SOC_* symbol.")
|
||||
endif()
|
||||
|
||||
# Apply the final optimization flag(s)
|
||||
zephyr_compile_options(${OPTIMIZATION_FLAG})
|
||||
|
||||
|
|
13
arch/Kconfig
13
arch/Kconfig
|
@ -18,18 +18,21 @@ source "$(ARCH_DIR)/$(ARCH)/Kconfig"
|
|||
|
||||
config ARC
|
||||
bool
|
||||
select ARCH_IS_SET
|
||||
select HAS_DTS
|
||||
help
|
||||
ARC architecture
|
||||
|
||||
config ARM
|
||||
bool
|
||||
select ARCH_IS_SET
|
||||
select HAS_DTS
|
||||
help
|
||||
ARM architecture
|
||||
|
||||
config X86
|
||||
bool
|
||||
select ARCH_IS_SET
|
||||
select ATOMIC_OPERATIONS_BUILTIN
|
||||
select HAS_DTS
|
||||
help
|
||||
|
@ -37,6 +40,7 @@ config X86
|
|||
|
||||
config NIOS2
|
||||
bool
|
||||
select ARCH_IS_SET
|
||||
select ATOMIC_OPERATIONS_C
|
||||
select HAS_DTS
|
||||
help
|
||||
|
@ -44,12 +48,14 @@ config NIOS2
|
|||
|
||||
config RISCV
|
||||
bool
|
||||
select ARCH_IS_SET
|
||||
select HAS_DTS
|
||||
help
|
||||
RISCV architecture
|
||||
|
||||
config XTENSA
|
||||
bool
|
||||
select ARCH_IS_SET
|
||||
select HAS_DTS
|
||||
select USE_SWITCH
|
||||
select USE_SWITCH_SUPPORTED
|
||||
|
@ -59,6 +65,7 @@ config XTENSA
|
|||
|
||||
config ARCH_POSIX
|
||||
bool
|
||||
select ARCH_IS_SET
|
||||
select ATOMIC_OPERATIONS_BUILTIN
|
||||
select ARCH_HAS_CUSTOM_SWAP_TO_MAIN
|
||||
select ARCH_HAS_CUSTOM_BUSY_WAIT
|
||||
|
@ -68,6 +75,12 @@ config ARCH_POSIX
|
|||
help
|
||||
POSIX (native) architecture
|
||||
|
||||
config ARCH_IS_SET
|
||||
bool
|
||||
help
|
||||
Helper symbol to detect SoCs forgetting to select one of the arch
|
||||
symbols above. See the top-level CMakeLists.txt.
|
||||
|
||||
menu "General Architecture Options"
|
||||
|
||||
module = ARCH
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue