change(test_apps): decouple netif_components from BUILD_COMPONENTS property

The BUILD_COMPONENTS build property only exists when building through the
Build system v1 compatibility shim. Query the executable library
interface's linked-components list instead, so the app does not depend on
compatibility-only properties.
This commit is contained in:
Sudeep Mohanty
2026-08-26 15:28:18 +02:00
parent d519de14d1
commit 052f444f32
@@ -56,7 +56,12 @@ idf_build_set_property(__BUILD_COMPONENT_DEPGRAPH_ENABLED 1)
project(network_components)
# Get the actual build components included in the build
idf_build_get_property(build_components BUILD_COMPONENTS)
if(IDF_BUILD_V2)
get_target_property(library ${project_elf} LIBRARY_INTERFACE)
idf_library_get_property(build_components "${library}" LIBRARY_COMPONENTS_LINKED)
else()
idf_build_get_property(build_components BUILD_COMPONENTS)
endif()
message(STATUS "Build components needed my main and ${component_under_test}:")
foreach(comp ${build_components})