diff --git a/CMakeLists.txt b/CMakeLists.txt index 578dd5047b..b802dd87b7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -67,6 +67,12 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(NUTTX_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +# unceaned previous make build can cause various types of cmake error +if(EXISTS "${NUTTX_DIR}/.config") + message( + FATAL_ERROR "Please distclean previous make build with `make distclean`") +endif() + if(NOT DEFINED BOARD_CONFIG) message(FATAL_ERROR "Please define configuration with BOARD_CONFIG") endif()