1if(CONFIG_FAT_FILESYSTEM_ELM)
2  add_library(ELMFAT INTERFACE)
3
4  target_include_directories(ELMFAT INTERFACE
5    ${CMAKE_CURRENT_SOURCE_DIR}
6    ${ZEPHYR_FATFS_MODULE_DIR}/include
7  )
8
9  target_compile_definitions(ELMFAT INTERFACE
10    ZEPHYR_CONFIG_OVERRIDE=zephyr_fatfs_config.h
11  )
12
13  zephyr_library()
14  zephyr_library_sources(
15    ${ZEPHYR_FATFS_MODULE_DIR}/ff.c
16    zfs_diskio.c
17    )
18
19  zephyr_library_sources_ifdef(CONFIG_FS_FATFS_LFN
20    ${ZEPHYR_FATFS_MODULE_DIR}/option/ffunicode.c
21  )
22
23  if(DEFINED CONFIG_FS_FATFS_LFN OR DEFINED CONFIG_FS_FATFS_REENTRANT)
24    zephyr_library_sources(zfs_ffsystem.c)
25  endif()
26
27  zephyr_library_link_libraries(ELMFAT)
28  target_link_libraries(ELMFAT INTERFACE zephyr_interface)
29endif()
30