Restore support for TARGET_OBJECTS in link interfaces with unity builds

This was broken by commit df08c37a42 (cmGlobalGenerator: Add unity/pch
sources after computing compile features, 2024-02-02, v3.28.3~1^2~1^2),
and 3.28.2's commit 76b5383123 (cmGlobalGenerator: add unity sources
after computing target compile features, 2024-01-01, v3.28.2~17^2~1).

The problem is very similar to that fixed by commit 4e8f24e977 (PCH:
Clear link interface cache when adding PCH object to it, 2022-01-24,
v3.23.0-rc1~44^2~9).  Generalize that fix.

Fixes: #25696
This commit is contained in:
Brad King
2024-02-21 16:00:42 -05:00
parent 1313c78a9c
commit 5b8e9e068f
8 changed files with 44 additions and 6 deletions
+4 -1
View File
@@ -721,7 +721,10 @@ public:
*/
void ClearSourcesCache();
// Do not use. This is only for a specific call site with a FIXME comment.
/**
* Clears cached evaluations of INTERFACE_LINK_LIBRARIES.
* They will be recomputed on demand.
*/
void ClearLinkInterfaceCache();
void AddSource(const std::string& src, bool before = false);