Skip to content

Commit

Permalink
cmake:add mtd driver dhara cmake build
Browse files Browse the repository at this point in the history
Signed-off-by: xuxin19 <[email protected]>
  • Loading branch information
xuxin930 committed Sep 14, 2024
1 parent 01b46c5 commit f8de786
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions drivers/mtd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

0 comments on commit f8de786

Please sign in to comment.