diff options
author | Stephen Kelly <steveire@gmail.com> | 2013-06-14 14:25:29 (GMT) |
---|---|---|
committer | Stephen Kelly <steveire@gmail.com> | 2013-06-24 14:22:15 (GMT) |
commit | ff015ee11e66388f50f9a1350e2731e7a240ccb1 (patch) | |
tree | 9774652c1b86df3287def9599276c8827a1cd4e9 /Tests/RunCMake/Languages | |
parent | b58aff90c5a3633ae7fa0d78731433d40a02d8bd (diff) | |
download | CMake-ff015ee11e66388f50f9a1350e2731e7a240ccb1.zip CMake-ff015ee11e66388f50f9a1350e2731e7a240ccb1.tar.gz CMake-ff015ee11e66388f50f9a1350e2731e7a240ccb1.tar.bz2 |
Genex: Report error if a target file is needed to evaluate link libraries.
Constructs such as
target_link_libraries(foo $<$<STREQUAL:$<TARGET_FILE:foo>,foo.so>:bar>)
segfault before this patch.
Diffstat (limited to 'Tests/RunCMake/Languages')
6 files changed, 21 insertions, 0 deletions
diff --git a/Tests/RunCMake/Languages/RunCMakeTest.cmake b/Tests/RunCMake/Languages/RunCMakeTest.cmake index 59ef5dc..6517a81 100644 --- a/Tests/RunCMake/Languages/RunCMakeTest.cmake +++ b/Tests/RunCMake/Languages/RunCMakeTest.cmake @@ -2,3 +2,5 @@ include(RunCMake) run_cmake(NoLangSHARED) run_cmake(LINK_LANGUAGE-genex) +run_cmake(link-libraries-TARGET_FILE-genex) +run_cmake(link-libraries-TARGET_FILE-genex-ok) diff --git a/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-ok-result.txt b/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-ok-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-ok-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-ok.cmake b/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-ok.cmake new file mode 100644 index 0000000..f0fd6e5 --- /dev/null +++ b/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-ok.cmake @@ -0,0 +1,6 @@ + +enable_language(CXX) + +add_library(foo SHARED empty.cpp) +add_library(bar SHARED empty.cpp) +target_link_libraries(foo $<$<STREQUAL:$<TARGET_FILE:bar>,anything>:bar>) diff --git a/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-result.txt b/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-stderr.txt b/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-stderr.txt new file mode 100644 index 0000000..2d7a3c9 --- /dev/null +++ b/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-stderr.txt @@ -0,0 +1,7 @@ +CMake Error: + Error evaluating generator expression: + + \$<TARGET_FILE:foo> + + Expressions which require the linker language may not be used while + evaluating link libraries diff --git a/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex.cmake b/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex.cmake new file mode 100644 index 0000000..eca73e9 --- /dev/null +++ b/Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex.cmake @@ -0,0 +1,4 @@ + +add_library(foo SHARED empty.cpp) +add_library(bar SHARED empty.cpp) +target_link_libraries(foo $<$<STREQUAL:$<TARGET_FILE:foo>,anything>:bar>) |