change(test_apps): decouple g0_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-18 10:28:50 +02:00
parent 73bbe343ec
commit 78d3f61757

View File

@@ -70,7 +70,12 @@ set(expected_components
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -nostdlib")
# Get all the components that were required to initialize this project
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()
# Sort lists to be able to compare them literally
list(SORT expected_components)