From de42aea18f20c83709c910e919c14bf4caa29058 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Fri, 7 Feb 2020 00:48:22 +0100 Subject: [PATCH] kconfig/cmake: Check that one of the CONFIG_ symbols is set All SoCs must now 'select' one of the CONFIG_ 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 --- CMakeLists.txt | 7 +++++++ arch/Kconfig | 13 +++++++++++++ 2 files changed, 20 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 90745084ab0..d4ac0716daf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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_ (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}) diff --git a/arch/Kconfig b/arch/Kconfig index 0f9d3fe8dde..b51746c4fb0 100644 --- a/arch/Kconfig +++ b/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