mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
58cca07104
add: private include header add: macro encapsulation for assertion or error check add: ESP_FAIL return code documentation in public headers change: replaced all assertions by NVS_ASSERT_OR_RETURN macro change: few internal function return values from void to esp_err_t change: ESP_ERR_NVS_VALUE_TOO_LONG macro comment
36 lines
1.3 KiB
CMake
36 lines
1.3 KiB
CMake
idf_build_get_property(target IDF_TARGET)
|
|
|
|
set(srcs "src/nvs_api.cpp"
|
|
"src/nvs_cxx_api.cpp"
|
|
"src/nvs_item_hash_list.cpp"
|
|
"src/nvs_page.cpp"
|
|
"src/nvs_pagemanager.cpp"
|
|
"src/nvs_storage.cpp"
|
|
"src/nvs_handle_simple.cpp"
|
|
"src/nvs_handle_locked.cpp"
|
|
"src/nvs_partition.cpp"
|
|
"src/nvs_partition_lookup.cpp"
|
|
"src/nvs_partition_manager.cpp"
|
|
"src/nvs_types.cpp")
|
|
|
|
idf_component_register(SRCS "${srcs}"
|
|
REQUIRES "spi_flash"
|
|
INCLUDE_DIRS "include"
|
|
PRIV_INCLUDE_DIRS "private_include")
|
|
|
|
# If we use the linux target, we need to redirect the crc functions to the linux
|
|
if(${target} STREQUAL "linux")
|
|
if(CONFIG_NVS_ENCRYPTION)
|
|
# mbedtls isn't configured for building with linux or as mock target. It will draw in all kind of dependencies
|
|
message(FATAL_ERROR "NVS currently doesn't support encryption if built for Linux.")
|
|
endif()
|
|
target_compile_options(${COMPONENT_LIB} PUBLIC "-DLINUX_TARGET")
|
|
target_compile_options(${COMPONENT_LIB} PUBLIC --coverage)
|
|
target_link_libraries(${COMPONENT_LIB} PUBLIC --coverage)
|
|
endif()
|
|
|
|
if(CONFIG_NVS_ENCRYPTION)
|
|
target_sources(${COMPONENT_LIB} PRIVATE "src/nvs_encrypted_partition.cpp")
|
|
target_link_libraries(${COMPONENT_LIB} PRIVATE idf::mbedtls)
|
|
endif()
|