Skip to content

Commit

Permalink
kconfig/cmake: Check that one of the CONFIG_<arch> symbols is set
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
ulfalizer authored and galak committed Feb 8, 2020
1 parent c5839f8 commit de42aea
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
7 changes: 7 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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})

Expand Down
13 changes: 13 additions & 0 deletions arch/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -18,38 +18,44 @@ 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
x86 architecture

config NIOS2
bool
select ARCH_IS_SET
select ATOMIC_OPERATIONS_C
select HAS_DTS
help
Nios II Gen 2 architecture

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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit de42aea

Please sign in to comment.