From b90c6b5b207f377f02a0852a8d48dbb325685af6 Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Mon, 2 Oct 2023 11:41:20 +0200 Subject: [PATCH] cmake: raise error if previous make build was not cleaned Uncleanded make build can cause various cmake errors. It's better to stop cmake build early and display an error. --- CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) 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()