mirror of
https://github.com/Kitware/CMake.git
synced 2026-05-23 00:08:41 -05:00
e0bbe79cea
In general we disallow references to transitive target properties, such
as `COMPILE_DEFINITIONS`, in `[INTERFACE_]LINK_LIBRARIES` properties,
because the latter establish the transitivity itself. Prior to CMP0189,
the `[INTERFACE_]LINK_LIBRARIES` properties were not themselves transitive
in `$<TARGET_PROPERTY>` expressions, so existing projects have code like
target_link_libraries(foo PRIVATE "$<TARGET_PROPERTY:tgt,LINK_LIBRARIES>")
Policy CMP0189's NEW behavior, introduced by commit b3da9c6d60 (GenEx:
Evaluate LINK_LIBRARIES target properties transitively, 2025-02-24,
v4.1.0-rc1~731^2), makes `$<TARGET_PROPERTY:tgt,LINK_LIBRARIES>`
transitive, causing the above to be rejected. Since evaluation of a
target's link libraries can already encounter and handle other targets'
link libraries, allow it in this case.
Fixes: #27265
6 lines
81 B
C
6 lines
81 B
C
extern int LinkLikewiseLib(void);
|
|
int main(void)
|
|
{
|
|
return LinkLikewiseLib();
|
|
}
|