From 53243675d436e296dfeca198885c9470d6950f88 Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Mon, 16 Feb 2026 17:09:16 +0100 Subject: [PATCH 1/3] fix(esp-tls): Fixed linux build for Build System v2 For Build System v2 on linux target, lwip dependency and ESP_TLS_WITH_LWIP definition must be conditional on CONFIG_LWIP_ENABLE rather than checking BUILD_COMPONENTS. v2 uses configuration-driven dependencies. --- components/esp-tls/CMakeLists.txt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/esp-tls/CMakeLists.txt b/components/esp-tls/CMakeLists.txt index b5eabfe4dc5..468456e67e2 100644 --- a/components/esp-tls/CMakeLists.txt +++ b/components/esp-tls/CMakeLists.txt @@ -12,6 +12,11 @@ endif() set(priv_req http_parser esp_timer) if(NOT ${IDF_TARGET} STREQUAL "linux") list(APPEND priv_req lwip) +else() + # For linux target on Build system v2, add lwip to PRIV_REQUIRES when CONFIG_LWIP_ENABLE is set. + if(CONFIG_LWIP_ENABLE AND IDF_BUILD_V2) + list(APPEND priv_req lwip) + endif() endif() idf_component_register(SRCS "${srcs}" @@ -27,8 +32,7 @@ if(NOT ${IDF_TARGET} STREQUAL "linux") idf_component_get_property(lwip lwip COMPONENT_LIB) set_property(TARGET ${lwip} APPEND PROPERTY LINK_INTERFACE_MULTIPLICITY 5) else() - # Check if LWIP in the build for linux target to adapt esp-tls compatibility layer - idf_build_get_property(build_components BUILD_COMPONENTS) + # For linux target, define ESP_TLS_WITH_LWIP if LWIP is enabled in the build if(CONFIG_LWIP_ENABLE) target_compile_definitions(${COMPONENT_LIB} PRIVATE ESP_TLS_WITH_LWIP=1) endif() From 6dabadae86a8fdeb7ac65e4c648fa6457d81a43a Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Mon, 16 Feb 2026 17:09:46 +0100 Subject: [PATCH 2/3] 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. --- components/tcp_transport/CMakeLists.txt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/components/tcp_transport/CMakeLists.txt b/components/tcp_transport/CMakeLists.txt index dabca0c0ccd..9c4fce482df 100644 --- a/components/tcp_transport/CMakeLists.txt +++ b/components/tcp_transport/CMakeLists.txt @@ -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) From 32d49b95f4f9ee876e7b810a4fc691fdc0366f7c Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Mon, 16 Feb 2026 17:10:40 +0100 Subject: [PATCH 3/3] fix(partition_table): Fixed linux build for Build System v2 Build System v2 does not have the internal __idf_build_target, so use ALL target instead for unconditional partition table generation on linux. --- components/partition_table/CMakeLists.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/partition_table/CMakeLists.txt b/components/partition_table/CMakeLists.txt index da57cbea2b1..e4697b27e89 100644 --- a/components/partition_table/CMakeLists.txt +++ b/components/partition_table/CMakeLists.txt @@ -134,7 +134,12 @@ if(${target} STREQUAL "linux" AND EXISTS ${partition_csv}) # target. This is a hack, since that target name is an implementation detail # of the build system. - add_dependencies(__idf_build_target partition-table) + if(IDF_BUILD_V2) + # Build system v2 does not support __idf_build_target target, so add to ALL target. + add_custom_target(partition-table-linux-build ALL DEPENDS partition-table) + else() + add_dependencies(__idf_build_target partition-table) + endif() endif() # Add signing steps