You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/09/15 02:29:32 UTC

(nuttx) 04/05: cmake:add mtd driver dhara cmake build

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

commit ec9935981200b0c870f6359a41537a049ad9c490
Author: xuxin19 <xu...@xiaomi.com>
AuthorDate: Tue Jun 11 21:40:55 2024 +0800

    cmake:add mtd driver dhara cmake build
    
    Signed-off-by: xuxin19 <xu...@xiaomi.com>
---
 drivers/mtd/CMakeLists.txt | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/mtd/CMakeLists.txt b/drivers/mtd/CMakeLists.txt
index af7fbcdeaf..ea9eabc99d 100644
--- a/drivers/mtd/CMakeLists.txt
+++ b/drivers/mtd/CMakeLists.txt
@@ -165,5 +165,21 @@ if(CONFIG_MTD)
     list(APPEND SRCS smart.c)
   endif()
 
+  if(CONFIG_MTD_DHARA)
+    if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/dhara)
+      FetchContent_Declare(
+        dhara
+        URL https://github.com/dlbeer/dhara/archive/refs/heads/master.zip
+            SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/dhara BINARY_DIR
+            ${CMAKE_BINARY_DIR}/drivers/mtd/dhara
+        DOWNLOAD_NO_PROGRESS true)
+      FetchContent_Populate(dhara)
+    endif()
+
+    list(APPEND SRCS dhara.c mtd/dhara/dhara/map.c mtd/dhara/dhara/error.c
+         mtd/dhara/dhara/journal.c)
+    target_include_directories(drivers PRIVATE ${CMAKE_CURRENT_LIST_DIR}/dhara)
+  endif()
+
   target_sources(drivers PRIVATE ${SRCS})
 endif()