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.
This commit is contained in:
Sudeep Mohanty
2026-07-31 15:49:54 +02:00
parent 9c778c954c
commit 5e7c5ed2cb

View File

@@ -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