mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-03 03:31:41 +03:00
refactor (nvs_flash)!: removed mbedtls as default dependency
mbedtls is only required in NVS if NVS encryption is enabled. Hence the mbedtls dependency is now only added if encryption is enabled, otherwise it is not added. BREAKING CHANGE: Removed mbedtls as default dependency
This commit is contained in:
@@ -24,19 +24,11 @@ if(${target} STREQUAL "linux")
|
||||
message(FATAL_ERROR "NVS currently doesn't support encryption if built for Linux.")
|
||||
endif()
|
||||
target_compile_options(${COMPONENT_LIB} PUBLIC "-DLINUX_TARGET")
|
||||
else()
|
||||
# TODO: this is a workaround until IDF-2085 is fixed
|
||||
idf_component_get_property(mbedtls_lib mbedtls COMPONENT_LIB)
|
||||
target_link_libraries(${COMPONENT_LIB} PUBLIC ${mbedtls_lib})
|
||||
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")
|
||||
idf_component_get_property(mbedtls_lib mbedtls COMPONENT_LIB)
|
||||
target_link_libraries(${COMPONENT_LIB} PUBLIC ${mbedtls_lib})
|
||||
endif()
|
||||
|
||||
if(${target} STREQUAL "linux")
|
||||
target_compile_options(${COMPONENT_LIB} PUBLIC --coverage)
|
||||
target_link_libraries(${COMPONENT_LIB} PUBLIC --coverage)
|
||||
target_link_libraries(${COMPONENT_LIB} PRIVATE idf::mbedtls)
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user