mirror of
https://github.com/espressif/esp-idf
synced 2025-03-09 09:09:10 -04:00
fix(cmake): Prevent overwriting of component properties in output file
While 'component_properties_text' correctly accumulated properties from all processed components, each iteration of the loop was overwriting the entire file content. Move the file(WRITE ...) call outside the loop to ensure all accumulated component properties are written once, preserving information for all components.
This commit is contained in:
parent
a97a7b0962
commit
bdf0821f97
@ -122,6 +122,7 @@ endfunction()
|
||||
# keeps a list of all its properties.
|
||||
#
|
||||
function(__component_write_properties output_file)
|
||||
set(component_properties_text "")
|
||||
idf_build_get_property(component_targets __COMPONENT_TARGETS)
|
||||
foreach(component_target ${component_targets})
|
||||
__component_get_property(component_properties ${component_target} __COMPONENT_PROPERTIES)
|
||||
@ -130,8 +131,8 @@ function(__component_write_properties output_file)
|
||||
set(component_properties_text
|
||||
"${component_properties_text}\nset(__component_${component_target}_${property} \"${val}\")")
|
||||
endforeach()
|
||||
file(WRITE ${output_file} "${component_properties_text}")
|
||||
endforeach()
|
||||
file(WRITE ${output_file} "${component_properties_text}")
|
||||
endfunction()
|
||||
|
||||
#
|
||||
|
Loading…
x
Reference in New Issue
Block a user