forked from espressif/esp-idf
fix(nvs): Adopted CMakeLists for host test if IDF v5.1
This commit is contained in:
@@ -1,5 +1,11 @@
|
|||||||
idf_build_get_property(target IDF_TARGET)
|
idf_build_get_property(target IDF_TARGET)
|
||||||
|
|
||||||
|
if(${target} STREQUAL "linux")
|
||||||
|
# omit newlib for linux
|
||||||
|
else()
|
||||||
|
list(APPEND priv_requires "newlib")
|
||||||
|
endif()
|
||||||
|
|
||||||
set(srcs "src/nvs_api.cpp"
|
set(srcs "src/nvs_api.cpp"
|
||||||
"src/nvs_cxx_api.cpp"
|
"src/nvs_cxx_api.cpp"
|
||||||
"src/nvs_item_hash_list.cpp"
|
"src/nvs_item_hash_list.cpp"
|
||||||
@@ -15,10 +21,9 @@ set(srcs "src/nvs_api.cpp"
|
|||||||
"src/nvs_platform.cpp")
|
"src/nvs_platform.cpp")
|
||||||
|
|
||||||
idf_component_register(SRCS "${srcs}"
|
idf_component_register(SRCS "${srcs}"
|
||||||
REQUIRES "esp_partition"
|
REQUIRES "esp_partition" "spi_flash"
|
||||||
PRIV_REQUIRES spi_flash newlib
|
PRIV_REQUIRES "${priv_requires}"
|
||||||
INCLUDE_DIRS "include"
|
INCLUDE_DIRS "include"
|
||||||
"../spi_flash/include"
|
|
||||||
PRIV_INCLUDE_DIRS "private_include")
|
PRIV_INCLUDE_DIRS "private_include")
|
||||||
|
|
||||||
# If we use the linux target, we need to redirect the crc functions to the linux
|
# If we use the linux target, we need to redirect the crc functions to the linux
|
||||||
|
@@ -1,5 +1,7 @@
|
|||||||
idf_build_get_property(target IDF_TARGET)
|
idf_build_get_property(target IDF_TARGET)
|
||||||
if(${target} STREQUAL "linux")
|
if(${target} STREQUAL "linux")
|
||||||
|
idf_component_register(INCLUDE_DIRS include
|
||||||
|
PRIV_INCLUDE_DIRS include/spi_flash)
|
||||||
return()
|
return()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user