zephyr/modules/fatfs/CMakeLists.txt
Dominik Ermel d41832f830 modules/fatfs: Move FATFS Zephyr specific code and cmake
The code moves Zephyr specific code and CMakeLists.txt
under modules/fatfs/.

The commit also adds zephyr_fatfs_config.h header file, that
is now used to override FF_ options of ffconf.h file within
fatfs repository.

Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
2022-11-21 16:48:14 +01:00

27 lines
652 B
CMake

if(CONFIG_FAT_FILESYSTEM_ELM)
add_library(ELMFAT INTERFACE)
target_include_directories(ELMFAT INTERFACE
${CMAKE_CURRENT_SOURCE_DIR}
${ZEPHYR_FATFS_MODULE_DIR}/include
)
target_compile_definitions(ELMFAT INTERFACE
ZEPHYR_CONFIG_OVERRIDE=zephyr_fatfs_config.h
)
zephyr_library()
zephyr_library_sources(
${ZEPHYR_FATFS_MODULE_DIR}/ff.c
zfs_diskio.c
)
zephyr_library_sources_ifdef(CONFIG_FS_FATFS_LFN
${ZEPHYR_FATFS_MODULE_DIR}/option/ffunicode.c
${ZEPHYR_FATFS_MODULE_DIR}/option/ffsystem.c
)
zephyr_library_link_libraries(ELMFAT)
target_link_libraries(ELMFAT INTERFACE zephyr_interface)
endif()