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")
|
assert(0 "Unreachable code. Expected optimization level to have been chosen. See Kconfig.zephyr")
|
||||||
endif()
|
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)
|
# Apply the final optimization flag(s)
|
||||||
zephyr_compile_options(${OPTIMIZATION_FLAG})
|
zephyr_compile_options(${OPTIMIZATION_FLAG})
|
||||||
|
|
||||||
|
|
13
arch/Kconfig
13
arch/Kconfig
|
@ -18,18 +18,21 @@ source "$(ARCH_DIR)/$(ARCH)/Kconfig"
|
||||||
|
|
||||||
config ARC
|
config ARC
|
||||||
bool
|
bool
|
||||||
|
select ARCH_IS_SET
|
||||||
select HAS_DTS
|
select HAS_DTS
|
||||||
help
|
help
|
||||||
ARC architecture
|
ARC architecture
|
||||||
|
|
||||||
config ARM
|
config ARM
|
||||||
bool
|
bool
|
||||||
|
select ARCH_IS_SET
|
||||||
select HAS_DTS
|
select HAS_DTS
|
||||||
help
|
help
|
||||||
ARM architecture
|
ARM architecture
|
||||||
|
|
||||||
config X86
|
config X86
|
||||||
bool
|
bool
|
||||||
|
select ARCH_IS_SET
|
||||||
select ATOMIC_OPERATIONS_BUILTIN
|
select ATOMIC_OPERATIONS_BUILTIN
|
||||||
select HAS_DTS
|
select HAS_DTS
|
||||||
help
|
help
|
||||||
|
@ -37,6 +40,7 @@ config X86
|
||||||
|
|
||||||
config NIOS2
|
config NIOS2
|
||||||
bool
|
bool
|
||||||
|
select ARCH_IS_SET
|
||||||
select ATOMIC_OPERATIONS_C
|
select ATOMIC_OPERATIONS_C
|
||||||
select HAS_DTS
|
select HAS_DTS
|
||||||
help
|
help
|
||||||
|
@ -44,12 +48,14 @@ config NIOS2
|
||||||
|
|
||||||
config RISCV
|
config RISCV
|
||||||
bool
|
bool
|
||||||
|
select ARCH_IS_SET
|
||||||
select HAS_DTS
|
select HAS_DTS
|
||||||
help
|
help
|
||||||
RISCV architecture
|
RISCV architecture
|
||||||
|
|
||||||
config XTENSA
|
config XTENSA
|
||||||
bool
|
bool
|
||||||
|
select ARCH_IS_SET
|
||||||
select HAS_DTS
|
select HAS_DTS
|
||||||
select USE_SWITCH
|
select USE_SWITCH
|
||||||
select USE_SWITCH_SUPPORTED
|
select USE_SWITCH_SUPPORTED
|
||||||
|
@ -59,6 +65,7 @@ config XTENSA
|
||||||
|
|
||||||
config ARCH_POSIX
|
config ARCH_POSIX
|
||||||
bool
|
bool
|
||||||
|
select ARCH_IS_SET
|
||||||
select ATOMIC_OPERATIONS_BUILTIN
|
select ATOMIC_OPERATIONS_BUILTIN
|
||||||
select ARCH_HAS_CUSTOM_SWAP_TO_MAIN
|
select ARCH_HAS_CUSTOM_SWAP_TO_MAIN
|
||||||
select ARCH_HAS_CUSTOM_BUSY_WAIT
|
select ARCH_HAS_CUSTOM_BUSY_WAIT
|
||||||
|
@ -68,6 +75,12 @@ config ARCH_POSIX
|
||||||
help
|
help
|
||||||
POSIX (native) architecture
|
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"
|
menu "General Architecture Options"
|
||||||
|
|
||||||
module = ARCH
|
module = ARCH
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue