From 5e7c5ed2cbf95d45b3cd45e1f62a5da886383883 Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Fri, 31 Jul 2026 15:49:54 +0200 Subject: [PATCH] fix(buildv2): include component-set LINK_OPTIONS as a GENERATOR_EXPRESSION idf_build_library() captured the LINK_OPTIONS build property before including the components, so a link option a component appended while it was processed was dropped from the executable link. Read the property as a generator expression so these options are included. --- tools/cmakev2/build.cmake | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/cmakev2/build.cmake b/tools/cmakev2/build.cmake index 97fd2bcd7a7..1017154a771 100644 --- a/tools/cmakev2/build.cmake +++ b/tools/cmakev2/build.cmake @@ -432,8 +432,10 @@ function(idf_build_library library) idf_build_get_property(include_directories INCLUDE_DIRECTORIES GENERATOR_EXPRESSION) target_include_directories("${library}" INTERFACE "${include_directories}") - # Add link options. - idf_build_get_property(link_options LINK_OPTIONS) + # Add link options. Read as a generator expression so that link options a + # component appends to the LINK_OPTIONS build property while it is processed + # below are included, not only those set before this point. + idf_build_get_property(link_options LINK_OPTIONS GENERATOR_EXPRESSION) target_link_options(${library} INTERFACE "${link_options}") # Include the requested components and link their interface targets to the