cmake: Replace assert with fatal error message

Use vanilla cmake FATAL_ERROR messages instead of assert.

Signed-off-by: Pieter De Gendt <pieter.degendt@basalte.be>
This commit is contained in:
Pieter De Gendt 2024-04-04 10:34:46 +02:00 committed by Fabio Baltieri
parent 68be1711c8
commit 32c9614bd8

View file

@ -200,7 +200,8 @@ elseif(CONFIG_SPEED_OPTIMIZATIONS)
elseif(CONFIG_SIZE_OPTIMIZATIONS) elseif(CONFIG_SIZE_OPTIMIZATIONS)
set(OPTIMIZATION_FLAG ${OPTIMIZE_FOR_SIZE_FLAG}) # Default in kconfig set(OPTIMIZATION_FLAG ${OPTIMIZE_FOR_SIZE_FLAG}) # Default in kconfig
else() else()
assert(0 "Unreachable code. Expected optimization level to have been chosen. See Kconfig.zephyr") message(FATAL_ERROR
"Unreachable code. Expected optimization level to have been chosen. See Kconfig.zephyr")
endif() endif()
if(NOT CONFIG_ARCH_IS_SET) if(NOT CONFIG_ARCH_IS_SET)
@ -247,7 +248,8 @@ if(CONFIG_CPP)
set(STD_CPP_DIALECT_FLAGS $<TARGET_PROPERTY:compiler-cpp,dialect_cpp2b>) set(STD_CPP_DIALECT_FLAGS $<TARGET_PROPERTY:compiler-cpp,dialect_cpp2b>)
list(APPEND CMAKE_CXX_COMPILE_FEATURES ${compile_features_cpp20}) list(APPEND CMAKE_CXX_COMPILE_FEATURES ${compile_features_cpp20})
else() else()
assert(0 "Unreachable code. Expected C++ standard to have been chosen. See Kconfig.zephyr.") message(FATAL_ERROR
"Unreachable code. Expected C++ standard to have been chosen. See Kconfig.zephyr.")
endif() endif()
set(CMAKE_CXX_COMPILE_FEATURES ${CMAKE_CXX_COMPILE_FEATURES} PARENT_SCOPE) set(CMAKE_CXX_COMPILE_FEATURES ${CMAKE_CXX_COMPILE_FEATURES} PARENT_SCOPE)