mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 21:59:54 -06:00
Commit v2.8.11~156^2~2 (Expand includes and defines transitively
in 'external' genexes., 2013-02-13) introduced a recursive loop
and a stack overflow during evaluation of a link implementation
which depends on a transitive property, such as
add_library(empty1 ...)
add_library(empty2 ...)
target_link_libraries(empty1
PRIVATE
$<$<STREQUAL:$<TARGET_PROPERTY:INCLUDE_DIRECTORIES>,/foo/bar>:empty2>
)
There is no use-case for code like that currently, but it should not
cause a stack overflow.
Avoid the recursion by reporting an error early if a case like this
is found.
15 lines
451 B
CMake
15 lines
451 B
CMake
|
|
add_library(empty1 SHARED empty.cpp)
|
|
add_library(empty2 SHARED empty.cpp)
|
|
|
|
# The INTERFACE_INCLUDE_DIRECTORIES do not depend on the link interface.
|
|
# On its own, this is fine. It is only when used by empty3 that an error
|
|
# is appropriately issued.
|
|
target_link_libraries(empty1
|
|
INTERFACE
|
|
$<$<STREQUAL:$<TARGET_PROPERTY:INTERFACE_INCLUDE_DIRECTORIES>,/foo/bar>:empty2>
|
|
)
|
|
|
|
add_library(empty3 SHARED empty.cpp)
|
|
target_link_libraries(empty3 empty1)
|