feat(cmakev2/build): add idf_build_generate_depgraph function

The idf_build_generate_depgraph function creates a component dependency
graph in dot (graphviz) format for a specified executable. It uses
existing helper functions from cmakev1, ensuring that the generated dot
files are produced in the same manner as in cmakev1. While adjustments
might be needed in the future if necessary, the current implementation
is intended to offer the same functionality as cmakev1.  Similar to
cmakev1, the dot files are only generated only when the
__BUILD_COMPONENT_DEPGRAPH_ENABLED build property is set.

Signed-off-by: Frantisek Hrbata <frantisek.hrbata@espressif.com>
This commit is contained in:
Frantisek Hrbata
2025-12-12 11:55:35 +01:00
parent 31d01bc6bd
commit 211b2da437
4 changed files with 82 additions and 3 deletions
+6
View File
@@ -15,6 +15,8 @@ add_custom_target(flash)
idf_project_init()
idf_build_set_property(__BUILD_COMPONENT_DEPGRAPH_ENABLED 1)
# Test component priority
function(test_component_priority)
# Set the idf component to be replaced with a testing component of higher
@@ -232,6 +234,8 @@ function(test_executable)
TARGET menuconfig-fatfs)
idf_build_generate_metadata(fatfs_example_bin
OUTPUT_FILE project_description_fatfs.json)
idf_build_generate_depgraph(fatfs_example
OUTPUT_FILE component_deps_fatfs.dot)
idf_create_confserver(fatfs_example
TARGET confserver-fatfs)
@@ -255,6 +259,8 @@ function(test_executable)
TARGET menuconfig-hello_world)
idf_build_generate_metadata(hello_world_example_bin
OUTPUT_FILE project_description_hello_world.json)
idf_build_generate_depgraph(hello_world_example
OUTPUT_FILE component_deps_hello_world.dot)
idf_create_confserver(hello_world_example
TARGET confserver-hello_world)