diff --git a/components/console/CMakeLists.txt b/components/console/CMakeLists.txt index 09eecbd209..ed20f246bb 100644 --- a/components/console/CMakeLists.txt +++ b/components/console/CMakeLists.txt @@ -5,12 +5,13 @@ set(srcs "commands.c" "split_argv.c" "linenoise/linenoise.c") +set(requires vfs) + if(${target} STREQUAL "linux") list(APPEND srcs "esp_console_repl_linux.c") - set(requires "") else() list(APPEND srcs "esp_console_repl_chip.c") - set(requires vfs esp_vfs_console) + list(APPEND requires esp_vfs_console) endif() set(argtable_srcs argtable3/arg_cmd.c diff --git a/components/console/esp_console_common.c b/components/console/esp_console_common.c index adb7c054da..dac7729d45 100644 --- a/components/console/esp_console_common.c +++ b/components/console/esp_console_common.c @@ -10,7 +10,11 @@ #include "console_private.h" #include "esp_log.h" #include "linenoise/linenoise.h" + #include "esp_vfs_eventfd.h" +#if CONFIG_IDF_TARGET_LINUX +#include +#endif static const char *TAG = "console.common"; diff --git a/components/vfs/CMakeLists.txt b/components/vfs/CMakeLists.txt index 0d47c4dc97..51d7a21dd7 100644 --- a/components/vfs/CMakeLists.txt +++ b/components/vfs/CMakeLists.txt @@ -1,7 +1,10 @@ idf_build_get_property(target IDF_TARGET) +# On Linux, we only support a few features, hence this simple component registration if(${target} STREQUAL "linux") - return() # This component is not supported by the POSIX/Linux simulator + idf_component_register(SRCS "vfs_eventfd_linux.c" + INCLUDE_DIRS "include") + return() endif() list(APPEND sources "vfs.c" diff --git a/components/vfs/vfs_eventfd_linux.c b/components/vfs/vfs_eventfd_linux.c new file mode 100644 index 0000000000..de00b10490 --- /dev/null +++ b/components/vfs/vfs_eventfd_linux.c @@ -0,0 +1,19 @@ +/* + * SPDX-FileCopyrightText: 2025 Espressif Systems (Shanghai) CO LTD + * + * SPDX-License-Identifier: Apache-2.0 + */ + +#include "esp_vfs_eventfd.h" +#include + +esp_err_t esp_vfs_eventfd_register(const esp_vfs_eventfd_config_t *config) +{ + (void)config; + return ESP_OK; +} + +esp_err_t esp_vfs_eventfd_unregister(void) +{ + return ESP_OK; +}