
In commit f3ad061858
(Add usage requirements to update direct link
dependencies, 2022-01-12, v3.23.0-rc1~44^2), we evaluated the transitive
closure of `INTERFACE_LINK_LIBRARIES` as a non-linking usage requirement.
That left out `INTERFACE_LINK_LIBRARIES_DIRECT` link dependencies that
appear behind private dependencies of a static library, guarded by the
`$<LINK_ONLY:...>` generator expression. At the time, that decision was
intentional, in order to prevent arbitrary usage requirements from
leaking out of `PRIVATE` dependencies.
Since then, we've revised evaluation of `LINK_LIBRARIES` to distinguish
between collecting link dependencies and other usage requirements. Use
that information when following `INTERFACE_LINK_LIBRARIES` to collect
the matching kind of requirements from `INTERFACE_LINK_LIBRARIES_DIRECT`.
Fixes: #22496
24 lines
566 B
C
24 lines
566 B
C
#ifdef DEF_DIRECT_FROM_A
|
|
# error "DEF_DIRECT_FROM_A incorrectly defined"
|
|
#endif
|
|
#ifdef DEF_DIRECT_FROM_A_FOR_EXE
|
|
# error "DEF_DIRECT_FROM_A_FOR_EXE incorrectly defined"
|
|
#endif
|
|
#ifdef DEF_DIRECT_FROM_A_OPTIONAL
|
|
# error "DEF_DIRECT_FROM_A_OPTIONAL incorrectly defined"
|
|
#endif
|
|
|
|
extern void static_A_private(void);
|
|
extern void direct_from_A(void);
|
|
extern void direct_from_A_for_exe(void);
|
|
extern void not_direct_from_A_optional(void);
|
|
|
|
int main(void)
|
|
{
|
|
static_A_private();
|
|
direct_from_A();
|
|
direct_from_A_for_exe();
|
|
not_direct_from_A_optional();
|
|
return 0;
|
|
}
|