cmComputeLinkInformation: Track targets named by TARGET_OBJECTS sources
Since !8197 (merged), the return value of
cmCommonTargetGenerator::GetLinkedTargetDirectories
must account for
linked object libraries because they may provide modules (see #25112 (closed)).
These were added by !8645 (merged). However, targets
named by $<TARGET_OBJECTS:...>
sources are also needed (see #25365 (closed)).
The latter were added by commit !8923 (merged). However, its
approach added link entries not actually specified by projects. It also
incorrectly re-used cmComputeLinkDepends::AddLinkObject
for object
library targets when it is meant for their individual object files.
These problems caused additional regressions (see #25417 (closed)). Revert the
implementation parts of those commits and leave behind an assertion and
comment to help avoid the mistake in the future. Instead, track targets
named by $<TARGET_OBJECTS:...>
sources with a dedicated member.
Issue: #25112 (closed)
Issue: #25365 (closed)
Fixes: #25417 (closed)
Co-authored-by: @ben.boeckel
Manual-backport: release-3.27
Backport: release