fix(tcp_transport): Fixed linux build for Build System v2

For Build System v2 on linux target, esp_timer dependency must be
conditional on CONFIG_LWIP_IPV4 rather than checking BUILD_COMPONENTS.
v2 uses configuration-driven dependencies.
This commit is contained in:
Sudeep Mohanty
2026-02-16 17:09:46 +01:00
committed by Frantisek Hrbata
parent f91c08b183
commit 55205d22c8
+9 -1
View File
@@ -16,6 +16,13 @@ endif()
set(req esp-tls)
if(NOT ${IDF_TARGET} STREQUAL "linux")
list(APPEND req lwip esp_timer)
else()
# Add esp_timer to REQUIRES for the linux target when Build system v2 is used
# since Build system v2 does not support BUILD_COMPONENTS and cannot link to
# esp_timer conditionally if LWIP is in the build.
if(CONFIG_LWIP_IPV4 AND IDF_BUILD_V2)
list(APPEND req esp_timer)
endif()
endif()
idf_component_register(SRCS "${srcs}"
@@ -23,9 +30,10 @@ idf_component_register(SRCS "${srcs}"
PRIV_INCLUDE_DIRS "private_include"
REQUIRES ${req})
if(${IDF_TARGET} STREQUAL "linux")
if(${IDF_TARGET} STREQUAL "linux" AND NOT IDF_BUILD_V2)
# Check if LWIP in the build for linux target to add esp_timer to the dependencies
# since socks_proxy transport needs it and lwip & linux build could use it
# Note: Build System v2 adds dependency on esp_timer during component registration
idf_build_get_property(build_components BUILD_COMPONENTS)
if("lwip" IN_LIST build_components)
idf_component_get_property(esp_timer esp_timer COMPONENT_LIB)