From 907d15062bbdaa721cedc938bf06f80237eeed43 Mon Sep 17 00:00:00 2001 From: xuxin19 Date: Wed, 11 Dec 2024 15:25:03 +0800 Subject: [PATCH] cmake(bugfix):fix common/etc confilt with src/etc in CMake genromfs We use the rules added later to overwrite the previous rules --- cmake/nuttx_add_romfs.cmake | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cmake/nuttx_add_romfs.cmake b/cmake/nuttx_add_romfs.cmake index 8a05e6952a..2ba2d0fdf9 100644 --- a/cmake/nuttx_add_romfs.cmake +++ b/cmake/nuttx_add_romfs.cmake @@ -340,12 +340,18 @@ function(process_all_directory_romfs) DEPENDS ${dyn_deps}) list(APPEND DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_ETC_SUFFIX}) else() + list(FIND DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_ETC_SUFFIX} index) + if(index GREATER -1) + set(APPEND_OPTION APPEND) + else() + set(APPEND_OPTION) + endif() list(APPEND DEPENDS ${SOURCE_ETC_PREFIX}/${SOURCE_ETC_SUFFIX}) add_custom_command( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_ETC_SUFFIX} COMMAND ${CMAKE_COMMAND} -E copy ${SOURCE_ETC_PREFIX}/${SOURCE_ETC_SUFFIX} - ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_ETC_SUFFIX} + ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_ETC_SUFFIX} ${APPEND_OPTION} DEPENDS ${dyn_deps}) list(APPEND DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${SOURCE_ETC_SUFFIX}) endif()