summaryrefslogtreecommitdiff
path: root/Tests/LinkLanguage
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-10-05 09:07:09 -0400
committerBrad King <brad.king@kitware.com>2009-10-05 09:07:09 -0400
commit750eb105c225a2c1b9e012fbae2cead4f12b83d4 (patch)
treee2594219ad744e47213da1a3dd748287fcd8d2f7 /Tests/LinkLanguage
parent0fb5b2c88c18925fae141a2fcf47a135d710bec4 (diff)
downloadcmake-750eb105c225a2c1b9e012fbae2cead4f12b83d4.tar.gz
Test target link information invalidation
We test this by adding export(TARGETS) to the LinkLanguage test to export the executable before the library is linked to it. Since export(TARGETS) computes the link interface of the target (so that it can export it), this ensures that the information is recomputed after the link library is added.
Diffstat (limited to 'Tests/LinkLanguage')
-rw-r--r--Tests/LinkLanguage/CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/Tests/LinkLanguage/CMakeLists.txt b/Tests/LinkLanguage/CMakeLists.txt
index 89c2982343..b4e53925d6 100644
--- a/Tests/LinkLanguage/CMakeLists.txt
+++ b/Tests/LinkLanguage/CMakeLists.txt
@@ -3,6 +3,11 @@ project(LinkLanguage C CXX)
add_library(foo STATIC foo.cxx)
add_executable(LinkLanguage LinkLanguage.c)
+
+# Export the target now to compute its link interface and implementation.
+# This tests that the link info is recomputed after the library is linked.
+export(TARGETS LinkLanguage FILE LinkLanguageTargets.cmake)
+
target_link_libraries(LinkLanguage foo)
# CMake should now automatically choose CXX for linking, so we need