summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2013-06-26 13:03:05 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2013-06-26 13:03:05 (GMT)
commitbef7c0251e397e6e4e01094c54ce5c3a333cf9ed (patch)
tree95cb019b4d5abb56a39a509fc1150d006b7133fa /Tests
parent63357bf9690c7a4ab95fd4114c09c07b4a123e26 (diff)
parentff015ee11e66388f50f9a1350e2731e7a240ccb1 (diff)
downloadCMake-bef7c0251e397e6e4e01094c54ce5c3a333cf9ed.zip
CMake-bef7c0251e397e6e4e01094c54ce5c3a333cf9ed.tar.gz
CMake-bef7c0251e397e6e4e01094c54ce5c3a333cf9ed.tar.bz2
Merge topic 'dag-LINKER_LANGUAGE'
ff015ee Genex: Report error if a target file is needed to evaluate link libraries. b58aff9 Genex: Extend EvaluatingLinkLibraries to also check the top target name. b1c19ce Genex: Make LINK_LANGUAGE report an error when evaluating link libraries. 0e1cb07 Add missing return after error report.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/Languages/LINK_LANGUAGE-genex-result.txt1
-rw-r--r--Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt6
-rw-r--r--Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake4
-rw-r--r--Tests/RunCMake/Languages/RunCMakeTest.cmake3
-rw-r--r--Tests/RunCMake/Languages/empty.cpp7
-rw-r--r--Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-ok-result.txt1
-rw-r--r--Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-ok.cmake6
-rw-r--r--Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-result.txt1
-rw-r--r--Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex-stderr.txt7
-rw-r--r--Tests/RunCMake/Languages/link-libraries-TARGET_FILE-genex.cmake4
10 files changed, 40 insertions, 0 deletions
diff --git a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-result.txt b/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt b/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt
new file mode 100644
index 0000000..8e0591d
--- /dev/null
+++ b/Tests/RunCMake/Languages/LINK_LANGUAGE-genex-stderr.txt
@@ -0,0 +1,6 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<LINK_LANGUAGE>
+
+ \$<LINK_LANGUAGE> expression can not be used while evaluating link libraries
diff --git a/Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake b/Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake
new file mode 100644
index 0000000..e0f8c57
--- /dev/null
+++ b/Tests/RunCMake/Languages/LINK_LANGUAGE-genex.cmake
@@ -0,0 +1,4 @@
+
+add_library(foo SHARED empty.cpp)
+add_library(bar SHARED empty.cpp)
+target_link_libraries(foo $<$<STREQUAL:$<LINK_LANGUAGE>,anything>:bar>)
diff --git a/Tests/RunCMake/Languages/RunCMakeTest.cmake b/Tests/RunCMake/Languages/RunCMakeTest.cmake
index a99548f..6517a81 100644
--- a/Tests/RunCMake/Languages/RunCMakeTest.cmake
+++ b/Tests/RunCMake/Languages/RunCMakeTest.cmake
@@ -1,3 +1,6 @@
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/empty.cpp b/Tests/RunCMake/Languages/empty.cpp
new file mode 100644
index 0000000..7279c5e
--- /dev/null
+++ b/Tests/RunCMake/Languages/empty.cpp
@@ -0,0 +1,7 @@
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+int empty(void)
+{
+ return 0;
+}
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>)