summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-06-02 11:53:34 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-06-02 11:53:40 (GMT)
commit855a7158ed5455f91892d408c4cdbf49e1b232cc (patch)
tree9a1cf511fd9b619e43b3d31599aa87445982d1ca /Tests/RunCMake
parent1b0b0c6427f5defe6dc8ede404f36d190276652a (diff)
parent9436ad35df17df89e1a74f91103b04baad085127 (diff)
downloadCMake-855a7158ed5455f91892d408c4cdbf49e1b232cc.zip
CMake-855a7158ed5455f91892d408c4cdbf49e1b232cc.tar.gz
CMake-855a7158ed5455f91892d408c4cdbf49e1b232cc.tar.bz2
Merge topic 'target_link_libraries-self-link-is-an-error'
9436ad35df target_link_libraries: self-link through ALIAS is an error Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !4826
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r--Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link-result.txt1
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link-stderr.txt5
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0108-OLD-self-link.cmake4
-rw-r--r--Tests/RunCMake/target_link_libraries/CMP0108-self-link.cmake9
-rw-r--r--Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake2
7 files changed, 26 insertions, 0 deletions
diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
index 2d270c5..2454f25 100644
--- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
+++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
@@ -31,6 +31,7 @@
\* CMP0099
\* CMP0104
\* CMP0105
+ \* CMP0108
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link-result.txt b/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link-stderr.txt b/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link-stderr.txt
new file mode 100644
index 0000000..7389eff
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link-stderr.txt
@@ -0,0 +1,5 @@
+CMake Error at CMP0108-self-link.cmake:[0-9]+ \(add_library\):
+ Target "foo" links to itself.
+Call Stack \(most recent call first\):
+ CMP0108-NEW-self-link.cmake:[0-9]+ \(include\)
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link.cmake b/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link.cmake
new file mode 100644
index 0000000..4ee9621
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/CMP0108-NEW-self-link.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy (SET CMP0108 NEW)
+
+include (CMP0108-self-link.cmake)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0108-OLD-self-link.cmake b/Tests/RunCMake/target_link_libraries/CMP0108-OLD-self-link.cmake
new file mode 100644
index 0000000..813104a
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/CMP0108-OLD-self-link.cmake
@@ -0,0 +1,4 @@
+
+cmake_policy (SET CMP0108 OLD)
+
+include (CMP0108-self-link.cmake)
diff --git a/Tests/RunCMake/target_link_libraries/CMP0108-self-link.cmake b/Tests/RunCMake/target_link_libraries/CMP0108-self-link.cmake
new file mode 100644
index 0000000..07a3490
--- /dev/null
+++ b/Tests/RunCMake/target_link_libraries/CMP0108-self-link.cmake
@@ -0,0 +1,9 @@
+
+cmake_policy (SET CMP0038 NEW)
+cmake_policy (SET CMP0042 NEW)
+
+enable_language(C)
+
+add_library(foo SHARED lib.c)
+add_library(Bar::foo ALIAS foo)
+target_link_libraries(foo PRIVATE Bar::foo)
diff --git a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
index fb223ab..dfa71dd 100644
--- a/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_libraries/RunCMakeTest.cmake
@@ -19,6 +19,8 @@ run_cmake(CMP0079-link-WARN)
run_cmake(CMP0079-link-OLD)
run_cmake(CMP0079-link-NEW)
run_cmake(CMP0079-link-NEW-bogus)
+run_cmake(CMP0108-OLD-self-link)
+run_cmake(CMP0108-NEW-self-link)
run_cmake(ImportedTarget)
run_cmake(ImportedTargetFailure)
run_cmake(MixedSignature)