summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle4.cmake
diff options
context:
space:
mode:
authorStephen Kelly <steveire@gmail.com>2014-05-11 14:04:53 (GMT)
committerStephen Kelly <steveire@gmail.com>2014-07-01 22:09:38 (GMT)
commit61ce6547424821710d0fbebf06b0eb411a630253 (patch)
tree157f3f2e3a30bdbda660a91c6c751f3dad7c1957 /Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle4.cmake
parentbf5fc1d5829e7995c0941996b4a515cbd46d4e4e (diff)
downloadCMake-61ce6547424821710d0fbebf06b0eb411a630253.zip
CMake-61ce6547424821710d0fbebf06b0eb411a630253.tar.gz
CMake-61ce6547424821710d0fbebf06b0eb411a630253.tar.bz2
Genex: Fix stack overflow in transitive property evaluation.
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.
Diffstat (limited to 'Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle4.cmake')
-rw-r--r--Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle4.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle4.cmake b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle4.cmake
new file mode 100644
index 0000000..ab6d0b2
--- /dev/null
+++ b/Tests/RunCMake/TargetPropertyGeneratorExpressions/LinkImplementationCycle4.cmake
@@ -0,0 +1,14 @@
+
+add_library(empty1 empty.cpp)
+add_library(empty2 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 empty.cpp)
+target_link_libraries(empty3 empty1)