summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2021-04-01 14:21:06 (GMT)
committerKitware Robot <kwrobot@kitware.com>2021-04-01 14:21:11 (GMT)
commitb362c0bb26906b053727b04a15a9bc6ef19b7859 (patch)
tree38fae85d9783e38c33bba512b8a283db9ae527ca /Tests
parent763b02b8f03b59e3061a2578561c9af1b85fc9b7 (diff)
parentbb96984ec932c899c9544ce21b6b63ef4c455e55 (diff)
downloadCMake-b362c0bb26906b053727b04a15a9bc6ef19b7859.zip
CMake-b362c0bb26906b053727b04a15a9bc6ef19b7859.tar.gz
CMake-b362c0bb26906b053727b04a15a9bc6ef19b7859.tar.bz2
Merge topic 'CUDA-device-link'
bb96984ec9 CUDA Device link: Ensure all link options are correctly formatted Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !5962
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/target_link_options/RunCMakeTest.cmake7
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-host_link_options-check.cmake4
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK-host_link_options-result.txt1
-rw-r--r--Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake8
4 files changed, 20 insertions, 0 deletions
diff --git a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake
index 8ef13f9..a707383 100644
--- a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake
+++ b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake
@@ -17,6 +17,9 @@ if (NOT CMAKE_C_COMPILER_ID STREQUAL "Intel")
if (NOT RunCMake_GENERATOR_IS_MULTI_CONFIG)
list(APPEND RunCMake_TEST_OPTIONS -DCMAKE_BUILD_TYPE=Release)
endif()
+ if (RunCMake_GENERATOR MATCHES "Ninja")
+ set(VERBOSE -- -v)
+ endif()
run_cmake(LINK_OPTIONS)
@@ -56,6 +59,10 @@ if (NOT CMAKE_C_COMPILER_ID STREQUAL "Intel")
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)
+
+ if (RunCMake_GENERATOR MATCHES "(Ninja|Unix Makefiles)")
+ run_cmake_target(genex_DEVICE_LINK host_link_options LinkOptions_host_link_options --config Release ${VERBOSE})
+ endif()
endif()
run_cmake_target(genex_DEVICE_LINK no_device LinkOptions_no_device --config Release)
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-host_link_options-check.cmake b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-host_link_options-check.cmake
new file mode 100644
index 0000000..31ffe7f
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-host_link_options-check.cmake
@@ -0,0 +1,4 @@
+
+if (NOT actual_stdout MATCHES "-Xlinker=OPT1 -Xlinker=OPT2 -Xlinker=OPT3 -Xlinker=OPT4 -Xlinker=OPT5")
+ set (RunCMake_TEST_FAILED "Not found expected '-Xlinker=OPT1 -Xlinker=OPT2 -Xlinker=OPT3 -Xlinker=OPT4 -Xlinker=OPT5'.")
+endif()
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-host_link_options-result.txt b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-host_link_options-result.txt
new file mode 100644
index 0000000..8d98f9d
--- /dev/null
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK-host_link_options-result.txt
@@ -0,0 +1 @@
+.*
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake
index 0126080..a53ab20 100644
--- a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake
+++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake
@@ -1,6 +1,10 @@
enable_language(C)
+set(CMAKE_VERBOSE_MAKEFILE TRUE)
+set(CMAKE_C_USE_RESPONSE_FILE_FOR_LIBRARIES FALSE)
+set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_LIBRARIES FALSE)
+
set (obj "${CMAKE_C_OUTPUT_EXTENSION}")
if(BORLAND)
set(pre -)
@@ -43,6 +47,10 @@ if (CMake_TEST_CUDA)
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_host_link_options LinkOptionsDevice.cu)
+ set_property(TARGET LinkOptions_host_link_options PROPERTY CUDA_SEPARABLE_COMPILATION ON)
+ target_link_options(LinkOptions_host_link_options PRIVATE -Wl,OPT1 -Xlinker=OPT2 "SHELL:-Xlinker OPT3" "SHELL:LINKER:OPT4 LINKER:OPT5")
endif()
add_executable(LinkOptions_no_device LinkOptionsDevice.cu)