diff options
author | Brad King <brad.king@kitware.com> | 2020-06-05 11:56:11 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-06-05 11:56:19 (GMT) |
commit | efac04465c96d5e1b244491c79994cc8bb2915d8 (patch) | |
tree | 4084011ae412cca5a1fdc8194aa3ebdd5f8d1640 /Tests/RunCMake | |
parent | 4af04586303da6fe0755423728c979aa8c84c301 (diff) | |
parent | b1243201e78b8ee403f1aa696a4a7f6f158caafb (diff) | |
download | CMake-efac04465c96d5e1b244491c79994cc8bb2915d8.zip CMake-efac04465c96d5e1b244491c79994cc8bb2915d8.tar.gz CMake-efac04465c96d5e1b244491c79994cc8bb2915d8.tar.bz2 |
Merge topic 'cuda_clang_separable_error'
b1243201e7 CUDA: Don't RunCMake generate separable compilation tests on Clang
1b4c690543 CUDA: Throw error if CUDA_SEPARABLE_COMPILATION is ON when using Clang
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !4827
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake index 4d0c02f..0126080 100644 --- a/Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake +++ b/Tests/RunCMake/target_link_options/genex_DEVICE_LINK.cmake @@ -21,26 +21,29 @@ target_link_options (LinkOptions_private PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEV 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}>) + # Separable compilation is only supported on NVCC. + if(NOT CMake_TEST_CUDA STREQUAL "Clang") + 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) + 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}>) + 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) + 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_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_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}>) + endif() add_executable(LinkOptions_no_device LinkOptionsDevice.cu) target_link_options(LinkOptions_no_device PRIVATE $<DEVICE_LINK:${pre}BADFLAG_DEVICE_LINK${obj}> |