summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-04-20 12:14:01 (GMT)
committerKitware Robot <kwrobot@kitware.com>2020-04-20 12:14:16 (GMT)
commit5d32699975d8623c19f74c75f22ee128a81508c8 (patch)
treecec2ddf9d7a234e9eb21cbc14e596f41f2995680 /Tests
parenta0a861b27f0a59f849d3d9e653310ce11f3036be (diff)
parent4248bb452a5886ec4b632e2d602fcaafd2b13aaf (diff)
downloadCMake-5d32699975d8623c19f74c75f22ee128a81508c8.zip
CMake-5d32699975d8623c19f74c75f22ee128a81508c8.tar.gz
CMake-5d32699975d8623c19f74c75f22ee128a81508c8.tar.bz2
Merge topic 'device-link'
4248bb452a CUDA: Device linking use now link options ec48e023f6 CUDA: Add information for LINKER: pattern translation 3fdae5acaa Genex: Add generator expressions $<DEVICE_LINK> and $<HOST_LINK> 38332fc4fa cmGeneratorExpressionDAGChecker: introduce method Top() Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Robert Maynard <robert.maynard@kitware.com> Merge-request: !4577
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_command-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_command-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_command.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_target-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_target-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_target.cmake3
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_executable-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_executable-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_executable.cmake1
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_library-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_library-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_library.cmake1
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_test-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_test-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_test.cmake5
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-install-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-install-stderr.txt7
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-install.cmake5
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-link_depends-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-link_depends-stderr.txt7
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-link_depends.cmake7
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_definitions-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_definitions-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_definitions.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_options-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_options-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_options.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_include_directories-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_include_directories-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_include_directories.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_directories-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_directories-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_directories.cmake7
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_libraries-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_libraries-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_libraries.cmake7
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_sources-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_sources-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_sources.cmake2
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_command-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_command-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_command.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_target-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_target-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_target.cmake3
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-add_executable-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-add_executable-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-add_executable.cmake1
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-add_library-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-add_library-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-add_library.cmake1
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-add_test-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-add_test-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-add_test.cmake5
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-install-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-install-stderr.txt7
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-install.cmake5
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-link_depends-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-link_depends-stderr.txt7
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-link_depends.cmake7
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_definitions-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_definitions-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_definitions.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_options-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_options-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_options.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-target_include_directories-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-target_include_directories-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-target_include_directories.cmake4
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_directories-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_directories-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_directories.cmake7
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_libraries-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_libraries-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_libraries.cmake7
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-target_sources-result.txt1
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-target_sources-stderr.txt9
-rw-r--r--Tests/RunCMake/GeneratorExpression/HOST_LINK-target_sources.cmake2
-rw-r--r--Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake30
-rw-r--r--Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt1
-rw-r--r--Tests/RunCMake/export/Repeat-CMP0103-WARN-stderr.txt4
-rw-r--r--Tests/RunCMake/target_link_options/LinkOptionsDevice.cu14
-rw-r--r--Tests/RunCMake/target_link_options/RunCMakeTest.cmake15
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-CMP0105_NEW-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-CMP0105_NEW-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-device-check.cmake3
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-device-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-interface-check.cmake3
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-interface-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-no_device-check.cmake3
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-no_device-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-private-check.cmake3
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-private-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-validation.cmake22
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake48
96 files changed, 514 insertions, 4 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 34e1fbc..f5472d9 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -471,7 +471,8 @@ add_RunCMake_test(ExportWithoutLanguage)
add_RunCMake_test(target_link_directories)
add_RunCMake_test(target_link_libraries)
add_RunCMake_test(add_link_options -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID})
-add_RunCMake_test(target_link_options -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID})
+add_RunCMake_test(target_link_options -DCMAKE_C_COMPILER_ID=${CMAKE_C_COMPILER_ID}
+ -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
add_RunCMake_test(target_compile_definitions)
add_RunCMake_test(target_compile_features)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_command-result.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_command-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_command-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_command-stderr.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_command-stderr.txt
new file mode 100644
index 0000000..eb15834
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_command-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at DEVICE_LINK-add_custom_command.cmake:[0-9]+ \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_command.cmake b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_command.cmake
new file mode 100644
index 0000000..01b3784
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_command.cmake
@@ -0,0 +1,4 @@
+add_custom_target(drive)
+add_custom_command(TARGET drive PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E echo $<DEVICE_LINK>
+)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_target-result.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_target-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_target-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_target-stderr.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_target-stderr.txt
new file mode 100644
index 0000000..cdd3043
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_target-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at DEVICE_LINK-add_custom_target.cmake:[0-9]+ \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_target.cmake b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_target.cmake
new file mode 100644
index 0000000..35728e9
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_custom_target.cmake
@@ -0,0 +1,3 @@
+add_custom_target(drive
+ COMMAND ${CMAKE_COMMAND} -E echo $<DEVICE_LINK>
+)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_executable-result.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_executable-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_executable-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_executable-stderr.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_executable-stderr.txt
new file mode 100644
index 0000000..56b595c
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_executable-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at DEVICE_LINK-add_executable.cmake:[0-9]+ \(add_executable\):
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK:empty.c>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_executable.cmake b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_executable.cmake
new file mode 100644
index 0000000..899f8f6
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_executable.cmake
@@ -0,0 +1 @@
+add_executable(empty $<DEVICE_LINK:empty.c>)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_library-result.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_library-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_library-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_library-stderr.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_library-stderr.txt
new file mode 100644
index 0000000..4477e00
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_library-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at DEVICE_LINK-add_library.cmake:[0-9]+ \(add_library\):
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK:empty.c>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_library.cmake b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_library.cmake
new file mode 100644
index 0000000..fc8547b
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_library.cmake
@@ -0,0 +1 @@
+add_library(empty $<DEVICE_LINK:empty.c>)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_test-result.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_test-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_test-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_test-stderr.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_test-stderr.txt
new file mode 100644
index 0000000..99561fe
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_test-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at DEVICE_LINK-add_test.cmake:[0-9]+ \(add_test\):
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_test.cmake b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_test.cmake
new file mode 100644
index 0000000..87d6ba1
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-add_test.cmake
@@ -0,0 +1,5 @@
+
+include(CTest)
+enable_testing()
+
+add_test(NAME dummy COMMAND ${CMAKE_COMMAND} -E echo $<DEVICE_LINK>)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-install-result.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-install-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-install-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-install-stderr.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-install-stderr.txt
new file mode 100644
index 0000000..afb3090
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-install-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK:empty>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-install.cmake b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-install.cmake
new file mode 100644
index 0000000..4b6dbef
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-install.cmake
@@ -0,0 +1,5 @@
+
+install(FILES
+ $<DEVICE_LINK:empty>
+ DESTINATION src
+)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-link_depends-result.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-link_depends-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-link_depends-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-link_depends-stderr.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-link_depends-stderr.txt
new file mode 100644
index 0000000..4fa0522
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-link_depends-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK:lib>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-link_depends.cmake b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-link_depends.cmake
new file mode 100644
index 0000000..8129514
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-link_depends.cmake
@@ -0,0 +1,7 @@
+
+enable_language(C)
+
+add_library(lib empty.c)
+
+add_executable(empty empty.c)
+set_property(TARGET empty PROPERTY LINK_DEPENDS $<DEVICE_LINK:lib>)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_definitions-result.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_definitions-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_definitions-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_definitions-stderr.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_definitions-stderr.txt
new file mode 100644
index 0000000..c0185e3
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_definitions-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at DEVICE_LINK-target_compile_definitions.cmake:[0-9]+ \(target_compile_definitions\):
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK:DEF>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_definitions.cmake b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_definitions.cmake
new file mode 100644
index 0000000..aaa8efc
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_definitions.cmake
@@ -0,0 +1,4 @@
+
+enable_language(C)
+add_executable(empty empty.c)
+target_compile_definitions(empty PRIVATE $<DEVICE_LINK:DEF>)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_options-result.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_options-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_options-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_options-stderr.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_options-stderr.txt
new file mode 100644
index 0000000..34ca4f2
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_options-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at DEVICE_LINK-target_compile_options.cmake:[0-9]+ \(target_compile_options\):
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK:-OPT>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_options.cmake b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_options.cmake
new file mode 100644
index 0000000..a9cb7fd
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_compile_options.cmake
@@ -0,0 +1,4 @@
+
+enable_language(C)
+add_executable(empty empty.c)
+target_compile_options(empty PRIVATE $<DEVICE_LINK:-OPT>)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_include_directories-result.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_include_directories-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_include_directories-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_include_directories-stderr.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_include_directories-stderr.txt
new file mode 100644
index 0000000..4d1642d
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_include_directories-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at DEVICE_LINK-target_include_directories.cmake:[0-9]+ \(target_include_directories\):
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK:/DIR>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_include_directories.cmake b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_include_directories.cmake
new file mode 100644
index 0000000..03cc413
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_include_directories.cmake
@@ -0,0 +1,4 @@
+
+enable_language(C)
+add_executable(empty empty.c)
+target_include_directories(empty PRIVATE $<DEVICE_LINK:/DIR>)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_directories-result.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_directories-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_directories-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_directories-stderr.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_directories-stderr.txt
new file mode 100644
index 0000000..d924916
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_directories-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at DEVICE_LINK-target_link_directories.cmake:[0-9]+ \(target_link_directories\):
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK:/DIR>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_directories.cmake b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_directories.cmake
new file mode 100644
index 0000000..e50d27d
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_directories.cmake
@@ -0,0 +1,7 @@
+
+enable_language(C)
+
+add_library(lib empty.c)
+
+add_executable(empty empty.c)
+target_link_directories(empty PRIVATE $<DEVICE_LINK:/DIR>)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_libraries-result.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_libraries-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_libraries-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_libraries-stderr.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_libraries-stderr.txt
new file mode 100644
index 0000000..1436fa8
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_libraries-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at DEVICE_LINK-target_link_libraries.cmake:[0-9]+ \(target_link_libraries\):
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK:lib>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_libraries.cmake b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_libraries.cmake
new file mode 100644
index 0000000..971f562
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_link_libraries.cmake
@@ -0,0 +1,7 @@
+
+enable_language(C)
+
+add_library(lib empty.c)
+
+add_executable(empty empty.c)
+target_link_libraries(empty PRIVATE $<DEVICE_LINK:lib>)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_sources-result.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_sources-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_sources-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_sources-stderr.txt b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_sources-stderr.txt
new file mode 100644
index 0000000..c9b602d
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_sources-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at DEVICE_LINK-target_sources.cmake:[0-9]+ \(target_sources\):
+ Error evaluating generator expression:
+
+ \$<DEVICE_LINK:empty.c>
+
+ \$<DEVICE_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_sources.cmake b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_sources.cmake
new file mode 100644
index 0000000..94bac9e
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/DEVICE_LINK-target_sources.cmake
@@ -0,0 +1,2 @@
+add_library(empty)
+target_sources(empty PRIVATE $<DEVICE_LINK:empty.c>)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_command-result.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_command-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_command-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_command-stderr.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_command-stderr.txt
new file mode 100644
index 0000000..5ad41b9
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_command-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at HOST_LINK-add_custom_command.cmake:[0-9]+ \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<HOST_LINK>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_command.cmake b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_command.cmake
new file mode 100644
index 0000000..4d6e305
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_command.cmake
@@ -0,0 +1,4 @@
+add_custom_target(drive)
+add_custom_command(TARGET drive PRE_BUILD
+ COMMAND ${CMAKE_COMMAND} -E echo $<HOST_LINK>
+)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_target-result.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_target-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_target-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_target-stderr.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_target-stderr.txt
new file mode 100644
index 0000000..c44202a
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_target-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at HOST_LINK-add_custom_target.cmake:[0-9]+ \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<HOST_LINK>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_target.cmake b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_target.cmake
new file mode 100644
index 0000000..eec072a
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_custom_target.cmake
@@ -0,0 +1,3 @@
+add_custom_target(drive
+ COMMAND ${CMAKE_COMMAND} -E echo $<HOST_LINK>
+)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_executable-result.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_executable-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_executable-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_executable-stderr.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_executable-stderr.txt
new file mode 100644
index 0000000..b395515
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_executable-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at HOST_LINK-add_executable.cmake:[0-9]+ \(add_executable\):
+ Error evaluating generator expression:
+
+ \$<HOST_LINK:empty.c>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_executable.cmake b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_executable.cmake
new file mode 100644
index 0000000..c9f74a5
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_executable.cmake
@@ -0,0 +1 @@
+add_executable(empty $<HOST_LINK:empty.c>)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_library-result.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_library-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_library-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_library-stderr.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_library-stderr.txt
new file mode 100644
index 0000000..4bd27be
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_library-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at HOST_LINK-add_library.cmake:[0-9]+ \(add_library\):
+ Error evaluating generator expression:
+
+ \$<HOST_LINK:empty.c>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_library.cmake b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_library.cmake
new file mode 100644
index 0000000..44135af
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_library.cmake
@@ -0,0 +1 @@
+add_library(empty $<HOST_LINK:empty.c>)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_test-result.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_test-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_test-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_test-stderr.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_test-stderr.txt
new file mode 100644
index 0000000..012ad21
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_test-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at HOST_LINK-add_test.cmake:[0-9]+ \(add_test\):
+ Error evaluating generator expression:
+
+ \$<HOST_LINK>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_test.cmake b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_test.cmake
new file mode 100644
index 0000000..4b472af
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-add_test.cmake
@@ -0,0 +1,5 @@
+
+include(CTest)
+enable_testing()
+
+add_test(NAME dummy COMMAND ${CMAKE_COMMAND} -E echo $<HOST_LINK>)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-install-result.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-install-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-install-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-install-stderr.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-install-stderr.txt
new file mode 100644
index 0000000..c265ec4
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-install-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<HOST_LINK:empty>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-install.cmake b/Tests/RunCMake/GeneratorExpression/HOST_LINK-install.cmake
new file mode 100644
index 0000000..b4dff68
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-install.cmake
@@ -0,0 +1,5 @@
+
+install(FILES
+ $<HOST_LINK:empty>
+ DESTINATION src
+)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-link_depends-result.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-link_depends-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-link_depends-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-link_depends-stderr.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-link_depends-stderr.txt
new file mode 100644
index 0000000..24b8b82
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-link_depends-stderr.txt
@@ -0,0 +1,7 @@
+CMake Error:
+ Error evaluating generator expression:
+
+ \$<HOST_LINK:lib>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-link_depends.cmake b/Tests/RunCMake/GeneratorExpression/HOST_LINK-link_depends.cmake
new file mode 100644
index 0000000..0402f43
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-link_depends.cmake
@@ -0,0 +1,7 @@
+
+enable_language(C)
+
+add_library(lib empty.c)
+
+add_executable(empty empty.c)
+set_property(TARGET empty PROPERTY LINK_DEPENDS $<HOST_LINK:lib>)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_definitions-result.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_definitions-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_definitions-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_definitions-stderr.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_definitions-stderr.txt
new file mode 100644
index 0000000..6ab3c14
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_definitions-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at HOST_LINK-target_compile_definitions.cmake:[0-9]+ \(target_compile_definitions\):
+ Error evaluating generator expression:
+
+ \$<HOST_LINK:DEF>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_definitions.cmake b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_definitions.cmake
new file mode 100644
index 0000000..f6c130d
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_definitions.cmake
@@ -0,0 +1,4 @@
+
+enable_language(C)
+add_executable(empty empty.c)
+target_compile_definitions(empty PRIVATE $<HOST_LINK:DEF>)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_options-result.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_options-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_options-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_options-stderr.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_options-stderr.txt
new file mode 100644
index 0000000..0f5bbc3
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_options-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at HOST_LINK-target_compile_options.cmake:[0-9]+ \(target_compile_options\):
+ Error evaluating generator expression:
+
+ \$<HOST_LINK:-OPT>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_options.cmake b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_options.cmake
new file mode 100644
index 0000000..53afea1
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_compile_options.cmake
@@ -0,0 +1,4 @@
+
+enable_language(C)
+add_executable(empty empty.c)
+target_compile_options(empty PRIVATE $<HOST_LINK:-OPT>)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_include_directories-result.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_include_directories-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_include_directories-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_include_directories-stderr.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_include_directories-stderr.txt
new file mode 100644
index 0000000..9a2634a
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_include_directories-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at HOST_LINK-target_include_directories.cmake:[0-9]+ \(target_include_directories\):
+ Error evaluating generator expression:
+
+ \$<HOST_LINK:/DIR>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_include_directories.cmake b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_include_directories.cmake
new file mode 100644
index 0000000..aff1009
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_include_directories.cmake
@@ -0,0 +1,4 @@
+
+enable_language(C)
+add_executable(empty empty.c)
+target_include_directories(empty PRIVATE $<HOST_LINK:/DIR>)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_directories-result.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_directories-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_directories-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_directories-stderr.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_directories-stderr.txt
new file mode 100644
index 0000000..5225a52
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_directories-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at HOST_LINK-target_link_directories.cmake:[0-9]+ \(target_link_directories\):
+ Error evaluating generator expression:
+
+ \$<HOST_LINK:/DIR>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_directories.cmake b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_directories.cmake
new file mode 100644
index 0000000..97488ee
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_directories.cmake
@@ -0,0 +1,7 @@
+
+enable_language(C)
+
+add_library(lib empty.c)
+
+add_executable(empty empty.c)
+target_link_directories(empty PRIVATE $<HOST_LINK:/DIR>)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_libraries-result.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_libraries-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_libraries-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_libraries-stderr.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_libraries-stderr.txt
new file mode 100644
index 0000000..6c4441f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_libraries-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at HOST_LINK-target_link_libraries.cmake:[0-9]+ \(target_link_libraries\):
+ Error evaluating generator expression:
+
+ \$<HOST_LINK:lib>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_libraries.cmake b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_libraries.cmake
new file mode 100644
index 0000000..d74c92d
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_link_libraries.cmake
@@ -0,0 +1,7 @@
+
+enable_language(C)
+
+add_library(lib empty.c)
+
+add_executable(empty empty.c)
+target_link_libraries(empty PRIVATE $<HOST_LINK:lib>)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_sources-result.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_sources-result.txt
new file mode 100644
index 0000000..d00491f
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_sources-result.txt
@@ -0,0 +1 @@
+1
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_sources-stderr.txt b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_sources-stderr.txt
new file mode 100644
index 0000000..0e25568
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_sources-stderr.txt
@@ -0,0 +1,9 @@
+CMake Error at HOST_LINK-target_sources.cmake:[0-9]+ \(target_sources\):
+ Error evaluating generator expression:
+
+ \$<HOST_LINK:empty.c>
+
+ \$<HOST_LINK:...> may only be used with binary targets to specify link
+ options.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:[0-9]+ \(include\)
diff --git a/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_sources.cmake b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_sources.cmake
new file mode 100644
index 0000000..ea7bf55
--- /dev/null
+++ b/Tests/RunCMake/GeneratorExpression/HOST_LINK-target_sources.cmake
@@ -0,0 +1,2 @@
+add_library(empty)
+target_sources(empty PRIVATE $<HOST_LINK:empty.c>)
diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
index 6550f84..24c3642 100644
--- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
+++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake
@@ -64,6 +64,36 @@ run_cmake(LINK_LANG_AND_ID-wrong-usage1)
run_cmake(LINK_LANG_AND_ID-wrong-usage2)
run_cmake(LINK_LANG_AND_ID-wrong-usage3)
run_cmake(LINK_LANG_AND_ID-file_generate)
+run_cmake(HOST_LINK-add_custom_target)
+run_cmake(HOST_LINK-add_custom_command)
+run_cmake(HOST_LINK-install)
+run_cmake(HOST_LINK-add_executable)
+run_cmake(HOST_LINK-add_library)
+run_cmake(HOST_LINK-add_test)
+run_cmake(HOST_LINK-target_sources)
+run_cmake(HOST_LINK-target_compile_definitions)
+run_cmake(HOST_LINK-target_compile_options)
+run_cmake(HOST_LINK-target_include_directories)
+run_cmake(HOST_LINK-target_link_libraries)
+run_cmake(HOST_LINK-target_link_directories)
+if(RunCMake_GENERATOR MATCHES "(Ninja|Makefile)")
+ run_cmake(HOST_LINK-link_depends)
+endif()
+run_cmake(DEVICE_LINK-add_custom_target)
+run_cmake(DEVICE_LINK-add_custom_command)
+run_cmake(DEVICE_LINK-install)
+run_cmake(DEVICE_LINK-add_executable)
+run_cmake(DEVICE_LINK-add_library)
+run_cmake(DEVICE_LINK-add_test)
+run_cmake(DEVICE_LINK-target_sources)
+run_cmake(DEVICE_LINK-target_compile_definitions)
+run_cmake(DEVICE_LINK-target_compile_options)
+run_cmake(DEVICE_LINK-target_include_directories)
+run_cmake(DEVICE_LINK-target_link_libraries)
+run_cmake(DEVICE_LINK-target_link_directories)
+if(RunCMake_GENERATOR MATCHES "(Ninja|Makefile)")
+ run_cmake(DEVICE_LINK-link_depends)
+endif()
run_cmake(TARGET_FILE-recursion)
run_cmake(OUTPUT_NAME-recursion)
run_cmake(TARGET_FILE_PREFIX)
diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
index 7ffd522..2d270c5 100644
--- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
+++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt
@@ -30,6 +30,7 @@
\* CMP0095
\* CMP0099
\* CMP0104
+ \* CMP0105
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
diff --git a/Tests/RunCMake/export/Repeat-CMP0103-WARN-stderr.txt b/Tests/RunCMake/export/Repeat-CMP0103-WARN-stderr.txt
index 3104df4..28e849d 100644
--- a/Tests/RunCMake/export/Repeat-CMP0103-WARN-stderr.txt
+++ b/Tests/RunCMake/export/Repeat-CMP0103-WARN-stderr.txt
@@ -1,5 +1,5 @@
CMake Warning \(dev\) at Repeat.cmake:[0-9]+ \(export\):
- Policy CMP0103 is not set: multiple export\(\) with same FILE without APPEND
+ Policy CMP0103 is not set: Multiple export\(\) with same FILE without APPEND
is not allowed. Run "cmake --help-policy CMP0103" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
@@ -14,7 +14,7 @@ Call Stack \(most recent call first\):
This warning is for project developers. Use -Wno-dev to suppress it.
CMake Warning \(dev\) at Repeat/CMakeLists.txt:[0-9]+ \(export\):
- Policy CMP0103 is not set: multiple export\(\) with same FILE without APPEND
+ Policy CMP0103 is not set: Multiple export\(\) with same FILE without APPEND
is not allowed. Run "cmake --help-policy CMP0103" for policy details. Use
the cmake_policy command to set the policy and suppress this warning.
diff --git a/Tests/RunCMake/target_link_options/LinkOptionsDevice.cu b/Tests/RunCMake/target_link_options/LinkOptionsDevice.cu
new file mode 100644
index 0000000..96504e1
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/LinkOptionsDevice.cu
@@ -0,0 +1,14 @@
+#include <cuda.h>
+
+#ifdef _WIN32
+__declspec(dllexport)
+#endif
+ int simplelib()
+{
+ return 0;
+}
+
+int main(void)
+{
+ return simplelib();
+}
diff --git a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake
index 9fdcdee..b919f48 100644
--- a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake
@@ -13,8 +13,9 @@ endmacro()
if (NOT CMAKE_C_COMPILER_ID STREQUAL "Intel")
# Intel compiler does not reject bad flags or objects!
set(RunCMake_TEST_OUTPUT_MERGE TRUE)
+ set(RunCMake_TEST_OPTIONS -DCMake_TEST_CUDA=${CMake_TEST_CUDA})
if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
- set(RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
+ list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
endif()
run_cmake(LINK_OPTIONS)
@@ -44,6 +45,18 @@ if (NOT CMAKE_C_COMPILER_ID STREQUAL "Intel")
run_cmake_target(genex_LINK_LANG_AND_ID mod LinkOptions_mod --config Release)
run_cmake_target(genex_LINK_LANG_AND_ID exe LinkOptions_exe --config Release)
+ run_cmake(genex_DEVICE_LINK)
+
+ run_cmake_target(genex_DEVICE_LINK interface LinkOptions_shared_interface --config Release)
+ run_cmake_target(genex_DEVICE_LINK private LinkOptions_private --config Release)
+ if (CMake_TEST_CUDA)
+ run_cmake_target(genex_DEVICE_LINK CMP0105_UNSET LinkOptions_CMP0105_UNSET --config Release)
+ run_cmake_target(genex_DEVICE_LINK CMP0105_OLD LinkOptions_CMP0105_OLD --config Release)
+ run_cmake_target(genex_DEVICE_LINK CMP0105_NEW LinkOptions_CMP0105_NEW --config Release)
+ run_cmake_target(genex_DEVICE_LINK device LinkOptions_device --config Release)
+ run_cmake_target(genex_DEVICE_LINK no_device LinkOptions_no_device --config Release)
+ endif()
+
unset(RunCMake_TEST_OPTIONS)
unset(RunCMake_TEST_OUTPUT_MERGE)
endif()
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-CMP0105_NEW-check.cmake b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-CMP0105_NEW-check.cmake
new file mode 100644
index 0000000..20c4fab
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-CMP0105_NEW-check.cmake
@@ -0,0 +1,4 @@
+
+if (NOT actual_stdout MATCHES "BADFLAG_DEVICE_LINK")
+ set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_DEVICE_LINK'.")
+endif()
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-CMP0105_NEW-result.txt b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-CMP0105_NEW-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-CMP0105_NEW-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-device-check.cmake b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-device-check.cmake
new file mode 100644
index 0000000..23c3b46
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-device-check.cmake
@@ -0,0 +1,3 @@
+set (DEVICE_LINK TRUE)
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_DEVICE_LINK-validation.cmake")
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-device-result.txt b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-device-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-device-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-interface-check.cmake b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-interface-check.cmake
new file mode 100644
index 0000000..8431e22
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-interface-check.cmake
@@ -0,0 +1,3 @@
+set (DEVICE_LINK FALSE)
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_DEVICE_LINK-validation.cmake")
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-interface-result.txt b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-interface-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-interface-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-no_device-check.cmake b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-no_device-check.cmake
new file mode 100644
index 0000000..8431e22
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-no_device-check.cmake
@@ -0,0 +1,3 @@
+set (DEVICE_LINK FALSE)
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_DEVICE_LINK-validation.cmake")
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-no_device-result.txt b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-no_device-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-no_device-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-private-check.cmake b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-private-check.cmake
new file mode 100644
index 0000000..8431e22
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-private-check.cmake
@@ -0,0 +1,3 @@
+set (DEVICE_LINK FALSE)
+
+include ("${CMAKE_CURRENT_LIST_DIR}/genex_DEVICE_LINK-validation.cmake")
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-private-result.txt b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-private-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-private-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-validation.cmake b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-validation.cmake
new file mode 100644
index 0000000..28f5d01
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-validation.cmake
@@ -0,0 +1,22 @@
+
+if (NOT DEFINED DEVICE_LINK)
+ set (DEVICE_LINK FALSE)
+endif()
+
+if (DEVICE_LINK)
+ set (VALID_ID DEVICE_LINK)
+ set (INVALID_ID NORMAL_LINK)
+else()
+ set (VALID_ID NORMAL_LINK)
+ set (INVALID_ID DEVICE_LINK)
+endif()
+
+if (NOT actual_stdout MATCHES "BADFLAG_${VALID_ID}")
+ set (RunCMake_TEST_FAILED "Not found expected 'BADFLAG_${VALID_ID}'.")
+endif()
+if (actual_stdout MATCHES "BADFLAG_${INVALID_ID}")
+ if (RunCMake_TEST_FAILED)
+ string (APPEND RunCMake_TEST_FAILED "\n")
+ endif()
+ string (APPEND RunCMake_TEST_FAILED "Found unexpected 'BADFLAG_${INVALID_ID}'.")
+endif()
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake
new file mode 100644
index 0000000..4d0c02f
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake
@@ -0,0 +1,48 @@
+
+enable_language(C)
+
+set (obj "${CMAKE_C_OUTPUT_EXTENSION}")
+if(BORLAND)
+ set(pre -)
+endif()
+
+add_library(LinkOptions_interface INTERFACE)
+target_link_options (LinkOptions_interface INTERFACE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>
+ $<HOST_LINK:${pre}BADFLAG_NORMAL_LINK${obj}>)
+
+add_library(LinkOptions_shared_interface SHARED LinkOptionsLib.c)
+target_link_libraries (LinkOptions_shared_interface PRIVATE LinkOptions_interface)
+
+
+add_library(LinkOptions_private SHARED LinkOptionsLib.c)
+target_link_options (LinkOptions_private PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>
+ $<HOST_LINK:${pre}BADFLAG_NORMAL_LINK${obj}>)
+
+if (CMake_TEST_CUDA)
+ enable_language(CUDA)
+
+ add_executable(LinkOptions_CMP0105_UNSET LinkOptionsDevice.cu)
+ set_property(TARGET LinkOptions_CMP0105_UNSET PROPERTY CUDA_SEPARABLE_COMPILATION ON)
+ target_link_options(LinkOptions_CMP0105_UNSET PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>)
+
+ cmake_policy(SET CMP0105 OLD)
+
+ add_executable(LinkOptions_CMP0105_OLD LinkOptionsDevice.cu)
+ set_property(TARGET LinkOptions_CMP0105_OLD PROPERTY CUDA_SEPARABLE_COMPILATION ON)
+ target_link_options(LinkOptions_CMP0105_OLD PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>)
+
+ cmake_policy(SET CMP0105 NEW)
+
+ add_executable(LinkOptions_CMP0105_NEW LinkOptionsDevice.cu)
+ set_property(TARGET LinkOptions_CMP0105_NEW PROPERTY CUDA_SEPARABLE_COMPILATION ON)
+ target_link_options(LinkOptions_CMP0105_NEW PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>)
+
+ add_executable(LinkOptions_device LinkOptionsDevice.cu)
+ set_property(TARGET LinkOptions_device PROPERTY CUDA_SEPARABLE_COMPILATION ON)
+ target_link_options(LinkOptions_device PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>
+ $<HOST_LINK:${pre}BADFLAG_NORMAL_LINK${obj}>)
+
+ add_executable(LinkOptions_no_device LinkOptionsDevice.cu)
+ target_link_options(LinkOptions_no_device PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}>
+ $<HOST_LINK:${pre}BADFLAG_NORMAL_LINK${obj}>)
+endif()