From 856eddaa4164ebb9b717d674752cd309e1094ee4 Mon Sep 17 00:00:00 2001 From: viayie Date: Wed, 16 Oct 2024 11:32:40 +0800 Subject: [PATCH] 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. --- tools/cmake/component.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/cmake/component.cmake b/tools/cmake/component.cmake index 1ad0ed05edee..cbe54be01d50 100644 --- a/tools/cmake/component.cmake +++ b/tools/cmake/component.cmake @@ -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() #