From 651102302aa84839a8558af96378cf765b4fa4f9 Mon Sep 17 00:00:00 2001 From: "radek.tandler" Date: Sat, 24 Feb 2024 01:13:35 +0100 Subject: [PATCH] fix(nvs): CMakeLists.txt adopted for nvs_host_test v4.4 --- components/nvs_flash/CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/components/nvs_flash/CMakeLists.txt b/components/nvs_flash/CMakeLists.txt index de9f25c311..680d2cbcf1 100644 --- a/components/nvs_flash/CMakeLists.txt +++ b/components/nvs_flash/CMakeLists.txt @@ -1,5 +1,12 @@ idf_build_get_property(target IDF_TARGET) +if(${target} STREQUAL "linux") + list(APPEND requires "spi_flash") +else() + list(APPEND requires "spi_flash") + list(APPEND requires "newlib") +endif() + set(srcs "src/nvs_api.cpp" "src/nvs_cxx_api.cpp" "src/nvs_item_hash_list.cpp" @@ -15,8 +22,7 @@ set(srcs "src/nvs_api.cpp" "src/nvs_platform.cpp") idf_component_register(SRCS "${srcs}" - REQUIRES "esp_partition" - PRIV_REQUIRES spi_flash newlib + REQUIRES "${requires}" INCLUDE_DIRS "include" PRIV_INCLUDE_DIRS "private_include")