This is an automated email from the ASF dual-hosted git repository. pkarashchenko pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit b1cc5b50b1329506db237c8a49597b7aedf62169 Author: xuxin19 <[email protected]> AuthorDate: Wed Sep 6 15:53:55 2023 +0800 cmake:complete missing changes during cmake reforming for fs Signed-off-by: xuxin19 <[email protected]> --- fs/hostfs/CMakeLists.txt | 14 +------------- fs/littlefs/CMakeLists.txt | 20 +++++++++++++++----- fs/partition/CMakeLists.txt | 15 +++++++++++++-- fs/procfs/CMakeLists.txt | 1 + fs/rpmsgfs/CMakeLists.txt | 8 ++------ fs/shm/CMakeLists.txt | 2 +- fs/vfs/CMakeLists.txt | 6 ++++++ 7 files changed, 39 insertions(+), 27 deletions(-) diff --git a/fs/hostfs/CMakeLists.txt b/fs/hostfs/CMakeLists.txt index d989ede733..dcbc26aaee 100644 --- a/fs/hostfs/CMakeLists.txt +++ b/fs/hostfs/CMakeLists.txt @@ -18,18 +18,6 @@ # # ############################################################################## -set(SRCS) - if(CONFIG_FS_HOSTFS) - list(APPEND SRCS hostfs.c) -endif() - -if(CONFIG_FS_HOSTFS_RPMSG) - list(APPEND SRCS hostfs_rpmsg.c) + target_sources(fs PRIVATE hostfs.c) endif() - -if(CONFIG_FS_HOSTFS_RPMSG_SERVER) - list(APPEND SRCS hostfs_rpmsg_server.c) -endif() - -target_sources(fs PRIVATE ${SRCS}) diff --git a/fs/littlefs/CMakeLists.txt b/fs/littlefs/CMakeLists.txt index b7e08784eb..b137ee5cc2 100644 --- a/fs/littlefs/CMakeLists.txt +++ b/fs/littlefs/CMakeLists.txt @@ -26,18 +26,28 @@ if(CONFIG_FS_LITTLEFS) littlefs URL https://github.com/ARMmbed/littlefs/archive/v${LITTLEFS_VERSION}.tar.gz SOURCE_DIR - ${CMAKE_CURRENT_LIST_DIR}/littlefs) + ${CMAKE_CURRENT_LIST_DIR}/littlefs + BINARY_DIR + ${CMAKE_BINARY_DIR}/fs/littlefs/littlefs + PATCH_COMMAND patch -p2 -d ${CMAKE_CURRENT_LIST_DIR} < + ${CMAKE_CURRENT_LIST_DIR}/lfs_util.patch) FetchContent_MakeAvailable(littlefs) endif() target_compile_definitions( fs - PRIVATE -DLFS_TRACE=finfo -DLFS_DEBUG=finfo -DLFS_WARN=fwarn - -DLFS_ERROR=ferr -DLFS_ASSERT=DEBUGASSERT - -DLFS_CONFIG=${CMAKE_CURRENT_LIST_DIR}/lfs_vfs.h) + PRIVATE -DLFS_TRACE=finfo + -DLFS_DEBUG=finfo + -DLFS_WARN=fwarn + -DLFS_ERROR=ferr + -DLFS_ASSERT=DEBUGASSERT + -DLFS_CONFIG=${CMAKE_CURRENT_LIST_DIR}/lfs_vfs.h + -DLFS_NAME_MAX=${CONFIG_FS_LITTLEFS_NAME_MAX} + -DLFS_FILE_MAX=${CONFIG_FS_LITTLEFS_FILE_MAX} + -DLFS_ATTR_MAX=${CONFIG_FS_LITTLEFS_ATTR_MAX}) target_sources(fs PRIVATE lfs_vfs.c ${CMAKE_CURRENT_LIST_DIR}/littlefs/lfs.c ${CMAKE_CURRENT_LIST_DIR}/littlefs/lfs_util.c) - target_include_directories(fs PRIVATE ${CMAKE_CURRENT_BINARY_DIR}) + target_include_directories(fs PRIVATE ${CMAKE_CURRENT_LIST_DIR}) endif() diff --git a/fs/partition/CMakeLists.txt b/fs/partition/CMakeLists.txt index 9b8015e1ea..0003e831fd 100644 --- a/fs/partition/CMakeLists.txt +++ b/fs/partition/CMakeLists.txt @@ -21,13 +21,24 @@ # Don't build anything if mountpoint doesn't support if(NOT CONFIG_DISABLE_MOUNTPOINT) - set(SRCS) - list(APPEND SRCS fs_partition.c) + set(SRCS fs_partition.c) if(CONFIG_PTABLE_PARTITION) list(APPEND SRCS fs_ptable.c) endif() + if(CONFIG_MBR_PARTITION) + list(APPEND SRCS fs_mbr.c) + endif() + + if(CONFIG_GPT_PARTITION) + list(APPEND SRCS fs_gpt.c) + endif() + + if(CONFIG_GPT_PARTITION) + list(APPEND SRCS fs_txtable.c) + endif() + target_sources(fs PRIVATE ${SRCS}) endif() diff --git a/fs/procfs/CMakeLists.txt b/fs/procfs/CMakeLists.txt index 05964f60a1..9af781a6be 100644 --- a/fs/procfs/CMakeLists.txt +++ b/fs/procfs/CMakeLists.txt @@ -25,6 +25,7 @@ if(CONFIG_FS_PROCFS) fs_procfscpuinfo.c fs_procfscpuload.c fs_procfscritmon.c + fs_procfsfdt.c fs_procfsiobinfo.c fs_procfsmeminfo.c fs_procfsproc.c diff --git a/fs/rpmsgfs/CMakeLists.txt b/fs/rpmsgfs/CMakeLists.txt index e36a6c7003..927e612349 100644 --- a/fs/rpmsgfs/CMakeLists.txt +++ b/fs/rpmsgfs/CMakeLists.txt @@ -18,14 +18,10 @@ # # ############################################################################## -set(SRCS) - if(CONFIG_FS_RPMSGFS) - list(APPEND SRCS rpmsgfs.c rpmsgfs_client.c) + target_sources(fs PRIVATE rpmsgfs.c rpmsgfs_client.c) endif() if(CONFIG_FS_RPMSGFS_SERVER) - list(APPEND SRCS rpmsgfs_server.c) + target_sources(fs PRIVATE rpmsgfs_server.c) endif() - -target_sources(fs PRIVATE ${SRCS}) diff --git a/fs/shm/CMakeLists.txt b/fs/shm/CMakeLists.txt index 6f46371380..d76fb17e3b 100644 --- a/fs/shm/CMakeLists.txt +++ b/fs/shm/CMakeLists.txt @@ -21,5 +21,5 @@ # Include POSIX message queue support if(CONFIG_FS_SHM) - target_sources(fs PRIVATE shm_open.c shm_close.c) + target_sources(fs PRIVATE shm_open.c shm_unlink.c shmfs.c shmfs_alloc.c) endif() diff --git a/fs/vfs/CMakeLists.txt b/fs/vfs/CMakeLists.txt index 6e4bb967ed..0b07ec3b68 100644 --- a/fs/vfs/CMakeLists.txt +++ b/fs/vfs/CMakeLists.txt @@ -54,6 +54,12 @@ if(NOT "${CONFIG_PSEUDOFS_SOFTLINKS}" STREQUAL "0") list(APPEND SRCS fs_link.c fs_symlink.c fs_readlink.c) endif() +# Pseudofile support + +if(CONFIG_PSEUDOFS_FILE) + list(APPEND SRCS fs_pseudofile.c) +endif() + # Stream support if(CONFIG_FILE_STREAM)
