mirror of
https://github.com/zephyrproject-rtos/zephyr
synced 2025-08-31 13:25:44 +00:00
File system API functions that operate on paths are passed both the absolute path including the mount point prefix, and the mount point within which the path lies. Unfortunately it's not entirely trivial to convert an arbitrary path within the file system space to an absolute path within its mount point, because the path may be to the mount point itself and not end with a directory separator. The effect is that a file system implementation like nffs may be given an empty path when "/" is required. Add an implementation module that does this transformation and use it to transform paths within each filesystem wrapper. Signed-off-by: Peter A. Bigot <pab@pabigot.com>
33 lines
1.1 KiB
CMake
33 lines
1.1 KiB
CMake
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
if(CONFIG_FILE_SYSTEM)
|
|
zephyr_interface_library_named(FS)
|
|
#zephyr_link_interface_ifdef(CONFIG_FAT_FILESYSTEM_ELM ELMFAT)
|
|
#zephyr_link_interface_ifdef(CONFIG_FILE_SYSTEM_NFFS NFFS)
|
|
|
|
zephyr_library()
|
|
zephyr_library_include_directories(${CMAKE_CURRENT_SOURCE_DIR})
|
|
zephyr_library_sources(fs.c fs_impl.c)
|
|
zephyr_library_sources_ifdef(CONFIG_FAT_FILESYSTEM_ELM fat_fs.c)
|
|
zephyr_library_sources_ifdef(CONFIG_FILE_SYSTEM_NFFS nffs_fs.c)
|
|
zephyr_library_sources_ifdef(CONFIG_FILE_SYSTEM_SHELL shell.c)
|
|
|
|
zephyr_library_link_libraries(FS)
|
|
|
|
target_link_libraries_ifdef(CONFIG_FAT_FILESYSTEM_ELM FS INTERFACE ELMFAT)
|
|
target_link_libraries_ifdef(CONFIG_FILE_SYSTEM_NFFS FS INTERFACE NFFS)
|
|
endif()
|
|
|
|
add_subdirectory_ifdef(CONFIG_FCB ./fcb)
|
|
add_subdirectory_ifdef(CONFIG_NVS ./nvs)
|
|
|
|
if(CONFIG_FUSE_FS_ACCESS)
|
|
zephyr_library_named(FS_FUSE)
|
|
find_package(PkgConfig REQUIRED)
|
|
pkg_search_module(FUSE REQUIRED fuse)
|
|
zephyr_include_directories(${FUSE_INCLUDE_DIR})
|
|
zephyr_link_libraries(${FUSE_LIBRARIES})
|
|
zephyr_library_compile_definitions(_FILE_OFFSET_BITS=64)
|
|
zephyr_library_sources(fuse_fs_access.c)
|
|
endif()
|