From e6b1c5857bc30c145e2b8a483e3c4b5048e40e2e Mon Sep 17 00:00:00 2001 From: Frantisek Hrbata Date: Wed, 8 Oct 2025 09:06:33 +0200 Subject: [PATCH] feat(cmakev2/build): rename LINKER_SCRIPTS_STATIC to LINKER_SCRIPTS Rename the LINKER_SCRIPTS_STATIC component property to LINKER_SCRIPTS. This property stores linker scripts that are not processed by ldgen, which essentially includes all of them. The only linker script processed by ldgen is sections.ld, which is handled by the esp_system component. This implies that there is likely no practical use case for other components to utilize ldgen processed linker scripts. This change is purely cosmetic to allow components to add linker scripts with: idf_component_set_property(${COMPONENT_TARGET} LINKER_SCRIPTS linker_script.ld APPEND) instead of idf_component_set_property(${COMPONENT_TARGET} LINKER_SCRIPTS_STATIC linker_script.ld APPEND) Signed-off-by: Frantisek Hrbata --- tools/cmakev2/build.cmake | 6 ++++-- tools/cmakev2/compat.cmake | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tools/cmakev2/build.cmake b/tools/cmakev2/build.cmake index aa9e544274f..b7711a0f2f4 100644 --- a/tools/cmakev2/build.cmake +++ b/tools/cmakev2/build.cmake @@ -388,12 +388,14 @@ function(idf_build_library library) foreach(component_interface IN LISTS component_interfaces_linked) set(scripts) + idf_component_get_property(component_dir "${component_interface}" COMPONENT_DIR) idf_component_get_property(component_build_dir "${component_interface}" COMPONENT_BUILD_DIR) idf_component_get_property(preprocessed "${component_interface}" __LINKER_SCRIPTS_PREPROCESSED) # Add linker scripts that do not require ldgen processing. - idf_component_get_property(scripts_static "${component_interface}" LINKER_SCRIPTS_STATIC) - foreach(script IN LISTS scripts_static) + idf_component_get_property(scripts_static "${component_interface}" LINKER_SCRIPTS) + __get_absolute_paths(PATHS "${scripts_static}" BASE_DIR "${component_dir}" OUTPUT scripts_static_abs) + foreach(script IN LISTS scripts_static_abs) if(script MATCHES "\\.in$") # If the linker script file name ends with the ".in" extension, # preprocess it with the C preprocessor. diff --git a/tools/cmakev2/compat.cmake b/tools/cmakev2/compat.cmake index 5b7e06793c1..68de4dbd9c8 100644 --- a/tools/cmakev2/compat.cmake +++ b/tools/cmakev2/compat.cmake @@ -190,7 +190,7 @@ function(target_linker_script target deptype scriptfiles) idf_component_set_property("${target}" LINKER_SCRIPTS_TEMPLATE "${scriptfile}" APPEND) idf_component_set_property("${target}" LINKER_SCRIPTS_GENERATED "${output}" APPEND) else() - idf_component_set_property("${target}" LINKER_SCRIPTS_STATIC ${scriptfile} APPEND) + idf_component_set_property("${target}" LINKER_SCRIPTS ${scriptfile} APPEND) endif() endforeach() endfunction()