This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new b90c6b5b20 cmake: raise error if previous make build was not cleaned
b90c6b5b20 is described below
commit b90c6b5b207f377f02a0852a8d48dbb325685af6
Author: raiden00pl <[email protected]>
AuthorDate: Mon Oct 2 11:41:20 2023 +0200
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()