mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-08 06:40:48 -06:00
Policy CMP0189, introduced by commit b3da9c6d60 (GenEx: Evaluate
LINK_LIBRARIES target properties transitively, 2025-02-24,
v4.1.0-rc1~731^2), takes effect at generation time, and so uses the
policy value as of the end of each directory. However, some projects
may rely on `file(GENERATE)` with the policy's OLD behavior in order
to extract targets' *direct* dependencies from `LINK_LIBRARIES`.
Pending a first-class solution to that problem, make it easier for
projects to port to the policy's NEW behavior in general while
retaining the OLD behavior in an isolated context.
Fixes: #27220
33 lines
1.3 KiB
CMake
33 lines
1.3 KiB
CMake
set(expect [[
|
|
# file\(GENERATE\) produced:
|
|
iface1 LINK_LIBRARIES: ''
|
|
iface1 INTERFACE_LINK_LIBRARIES: ''
|
|
iface2 LINK_LIBRARIES: ''
|
|
iface2 INTERFACE_LINK_LIBRARIES: 'iface1'
|
|
static1 LINK_LIBRARIES: 'iface2'
|
|
static1 INTERFACE_LINK_LIBRARIES: '\$<LINK_ONLY:iface2>'
|
|
main LINK_LIBRARIES: 'static1;object1'
|
|
main INTERFACE_LINK_LIBRARIES: ''
|
|
iface10 LINK_LIBRARIES: ''
|
|
iface10 INTERFACE_LINK_LIBRARIES: ''
|
|
iface11 LINK_LIBRARIES: ''
|
|
iface11 INTERFACE_LINK_LIBRARIES: 'iface10'
|
|
static10 LINK_LIBRARIES: 'iface11;iface10'
|
|
static10 INTERFACE_LINK_LIBRARIES: 'iface11;iface10'
|
|
static11 LINK_LIBRARIES: 'static10;iface11;iface11;iface10'
|
|
static11 INTERFACE_LINK_LIBRARIES: 'static10;iface11;iface11;iface10'
|
|
main10 LINK_LIBRARIES: 'static11;static10;static10;iface11;iface11;iface10'
|
|
main10 INTERFACE_LINK_LIBRARIES: ''
|
|
iface20 LINK_LIBRARIES: ''
|
|
iface20 INTERFACE_LINK_LIBRARIES: ''
|
|
iface21 LINK_LIBRARIES: ''
|
|
iface21 INTERFACE_LINK_LIBRARIES: 'iface20'
|
|
static20 LINK_LIBRARIES: 'iface21'
|
|
static20 INTERFACE_LINK_LIBRARIES: '\$<LINK_ONLY:iface21>'
|
|
static21 LINK_LIBRARIES: 'static20;iface21'
|
|
static21 INTERFACE_LINK_LIBRARIES: '\$<LINK_ONLY:static20>;\$<LINK_ONLY:iface21>'
|
|
main20 LINK_LIBRARIES: 'static21;static20'
|
|
main20 INTERFACE_LINK_LIBRARIES: ''
|
|
]])
|
|
include(${CMAKE_CURRENT_LIST_DIR}/../check-common.cmake)
|