2024-04-23 02:34:45 -04:00
|
|
|
set(srcs esp_tls.c esp-tls-crypto/esp_tls_crypto.c esp_tls_error_capture.c esp_tls_platform_port.c)
|
2019-09-07 06:54:54 -04:00
|
|
|
if(CONFIG_ESP_TLS_USING_MBEDTLS)
|
|
|
|
list(APPEND srcs
|
|
|
|
"esp_tls_mbedtls.c")
|
|
|
|
endif()
|
|
|
|
|
|
|
|
if(CONFIG_ESP_TLS_USING_WOLFSSL)
|
|
|
|
list(APPEND srcs
|
|
|
|
"esp_tls_wolfssl.c")
|
|
|
|
endif()
|
|
|
|
|
2022-11-08 03:38:12 -05:00
|
|
|
set(priv_req http_parser)
|
|
|
|
if(NOT ${IDF_TARGET} STREQUAL "linux")
|
2024-04-23 02:34:45 -04:00
|
|
|
list(APPEND priv_req lwip esp_timer)
|
2022-11-08 03:38:12 -05:00
|
|
|
endif()
|
|
|
|
|
2019-09-07 06:54:54 -04:00
|
|
|
idf_component_register(SRCS "${srcs}"
|
2019-11-26 04:09:13 -05:00
|
|
|
INCLUDE_DIRS . esp-tls-crypto
|
2019-08-05 23:00:37 -04:00
|
|
|
PRIV_INCLUDE_DIRS "private_include"
|
2024-04-23 02:34:45 -04:00
|
|
|
# mbedtls is public requirements because esp_tls.h
|
2022-05-02 01:30:19 -04:00
|
|
|
# includes mbedtls header files.
|
|
|
|
REQUIRES mbedtls
|
2022-11-08 03:38:12 -05:00
|
|
|
PRIV_REQUIRES ${priv_req})
|
2019-09-07 06:54:54 -04:00
|
|
|
|
|
|
|
if(CONFIG_ESP_TLS_USING_WOLFSSL)
|
|
|
|
idf_component_get_property(wolfssl esp-wolfssl COMPONENT_LIB)
|
|
|
|
target_link_libraries(${COMPONENT_LIB} PUBLIC ${wolfssl})
|
|
|
|
endif()
|
2020-04-06 10:42:52 -04:00
|
|
|
|
2022-11-08 03:38:12 -05:00
|
|
|
if(NOT ${IDF_TARGET} STREQUAL "linux")
|
2021-02-13 06:00:13 -05:00
|
|
|
# Increase link multiplicity to get some lwip symbols correctly resolved by the linker
|
|
|
|
# due to cyclic dependencies present in IDF for lwip/esp_netif/mbedtls
|
|
|
|
idf_component_get_property(lwip lwip COMPONENT_LIB)
|
|
|
|
set_property(TARGET ${lwip} APPEND PROPERTY LINK_INTERFACE_MULTIPLICITY 5)
|
2022-11-08 03:38:12 -05:00
|
|
|
endif()
|
2022-11-11 05:43:15 -05:00
|
|
|
|
|
|
|
if(CONFIG_ESP_TLS_USE_SECURE_ELEMENT)
|
|
|
|
idf_component_optional_requires(PRIVATE espressif__esp-cryptoauthlib esp-cryptoauthlib)
|
|
|
|
endif()
|