diff options
author | Brad King <brad.king@kitware.com> | 2020-05-19 18:02:51 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-05-20 14:48:20 (GMT) |
commit | 4c7cc264af285ec5c12989a8d18a5141a9c0dd68 (patch) | |
tree | 65a471b3638809eb233fecbba12b695552733eb8 /Tests/RunCMake | |
parent | b246dee7db2e7e6fcd2a00c5b2bd6db21045025f (diff) | |
download | CMake-4c7cc264af285ec5c12989a8d18a5141a9c0dd68.zip CMake-4c7cc264af285ec5c12989a8d18a5141a9c0dd68.tar.gz CMake-4c7cc264af285ec5c12989a8d18a5141a9c0dd68.tar.bz2 |
Tests: Restore NVCC-specific CUDA tests
In commit a653ca9504 (Tests: Update CUDA tests to work with Clang,
2020-03-27) some tests were conditioned using `CMAKE_CUDA_COMPILER_ID`.
That is not defined when configuring CMake itself, so it accidentally
turned off NVCC-specific CUDA tests altogether. Convert the conditions
to check `CMake_TEST_CUDA` for `Clang` instead. That option is added
explicitly to builds where we want the tests to run, so we can set it to
a value indicating the CUDA compiler vendor.
In commit a653ca9504 (Tests: Update CUDA tests to work with Clang,
2020-03-27) the NVCC-specific `CudaOnly.GPUDebugFlag` test was
accidentally broken by removing a space when appending `-G` to the CUDA
flags. This was covered by the test not running. Restore the space.
Fixes: #20727
Diffstat (limited to 'Tests/RunCMake')
-rw-r--r-- | Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/target_link_options/RunCMakeTest.cmake | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake index 449db4a..23b89d3 100644 --- a/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake +++ b/Tests/RunCMake/NinjaMultiConfig/RunCMakeTest.cmake @@ -286,7 +286,7 @@ run_cmake_command(NoUnusedVariables ${CMAKE_COMMAND} ${CMAKE_CURRENT_LIST_DIR} ) # CudaSimple uses separable compilation, which is currently only supported on NVCC. -if(CMake_TEST_CUDA AND CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") +if(CMake_TEST_CUDA AND NOT CMake_TEST_CUDA STREQUAL "Clang") set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/CudaSimple-build) run_cmake_configure(CudaSimple) include(${RunCMake_TEST_BINARY_DIR}/target_files.cmake) diff --git a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake index 2035eb4..8ef13f9 100644 --- a/Tests/RunCMake/target_link_options/RunCMakeTest.cmake +++ b/Tests/RunCMake/target_link_options/RunCMakeTest.cmake @@ -51,7 +51,7 @@ if (NOT CMAKE_C_COMPILER_ID STREQUAL "Intel") run_cmake_target(genex_DEVICE_LINK private LinkOptions_private --config Release) if (CMake_TEST_CUDA) # Separable compilation is only supported on NVCC. - if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") + if(NOT CMake_TEST_CUDA STREQUAL "Clang") 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) |