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.
This commit is contained in:
raiden00pl 2023-10-02 11:41:20 +02:00 committed by Xiang Xiao
parent c93c0ecd81
commit b90c6b5b20
1 changed files with 6 additions and 0 deletions

View File

@ -67,6 +67,12 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(NUTTX_DIR ${CMAKE_CURRENT_SOURCE_DIR}) 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) if(NOT DEFINED BOARD_CONFIG)
message(FATAL_ERROR "Please define configuration with BOARD_CONFIG") message(FATAL_ERROR "Please define configuration with BOARD_CONFIG")
endif() endif()