Skip to content

Commit

Permalink
fix(cmake): Prevent overwriting of component properties in output file
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
viayie committed Oct 16, 2024
1 parent a97a7b0 commit 856edda
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/cmake/component.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,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()

#
Expand Down

0 comments on commit 856edda

Please sign in to comment.