CMakeLists.txt 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. set(srcs esp_tls.c esp-tls-crypto/esp_tls_crypto.c esp_tls_error_capture.c)
  2. if(CONFIG_ESP_TLS_USING_MBEDTLS)
  3. list(APPEND srcs
  4. "esp_tls_mbedtls.c")
  5. endif()
  6. if(CONFIG_ESP_TLS_USING_WOLFSSL)
  7. list(APPEND srcs
  8. "esp_tls_wolfssl.c")
  9. endif()
  10. idf_component_register(SRCS "${srcs}"
  11. INCLUDE_DIRS . esp-tls-crypto
  12. PRIV_INCLUDE_DIRS "private_include"
  13. REQUIRES mbedtls
  14. PRIV_REQUIRES lwip nghttp)
  15. if(CONFIG_ESP_TLS_USING_WOLFSSL)
  16. idf_component_get_property(wolfssl esp-wolfssl COMPONENT_LIB)
  17. target_link_libraries(${COMPONENT_LIB} PUBLIC ${wolfssl})
  18. endif()
  19. if(CONFIG_ESP_TLS_USE_SE)
  20. idf_component_get_property(cryptoauthlib esp-cryptoauthlib COMPONENT_LIB)
  21. target_link_libraries(${COMPONENT_LIB} PUBLIC ${cryptoauthlib})
  22. endif()
  23. # Increase link multiplicity to get some lwip symbols correctly resolved by the linker
  24. # due to cyclic dependencies present in IDF for lwip/esp_netif/mbedtls
  25. idf_component_get_property(lwip lwip COMPONENT_LIB)
  26. set_property(TARGET ${lwip} APPEND PROPERTY LINK_INTERFACE_MULTIPLICITY 5)