diff options
author | Brad King <brad.king@kitware.com> | 2022-01-28 14:40:44 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2022-01-28 14:40:50 (GMT) |
commit | ba069c10dd6a52e58b2a846136fbfa6846aec971 (patch) | |
tree | 0f88842ad8ca642f8439cac5b483c1ee42c0a48a /Tests | |
parent | 4ff6ea0f2fcbac87c3317623e7de41cdd506ab17 (diff) | |
parent | daf372c4d686000fd2c6f380efa7f5ddfd915ceb (diff) | |
download | CMake-ba069c10dd6a52e58b2a846136fbfa6846aec971.zip CMake-ba069c10dd6a52e58b2a846136fbfa6846aec971.tar.gz CMake-ba069c10dd6a52e58b2a846136fbfa6846aec971.tar.bz2 |
Merge topic 'cuda_vs_arch_all'
daf372c4d6 CUDA: Fix issuing error if default architecture detection fails
7a0d098352 CUDA: Error on empty/invalid CMAKE_CUDA_ARCHITECTURES set by user
d19273bc7b CUDA: Support all and all-major on Visual Studio
5f667d783a CUDA: Actually use reverse architecture deprecation order for Clang
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Brad King <brad.king@kitware.com>
Merge-request: !6912
Diffstat (limited to 'Tests')
9 files changed, 27 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 6bea788..6a1c694 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -534,6 +534,10 @@ add_RunCMake_test(no_install_prefix) add_RunCMake_test(configure_file) add_RunCMake_test(CTestTimeout -DTIMEOUT=${CTestTestTimeout_TIME}) add_RunCMake_test(CTestTimeoutAfterMatch) +if(CMake_TEST_CUDA) + add_RunCMake_test(CUDA_architectures) + set_property(TEST RunCMake.CUDA_architectures APPEND PROPERTY LABELS "CUDA") +endif() add_RunCMake_test(DependencyGraph -DCMAKE_Fortran_COMPILER=${CMAKE_Fortran_COMPILER}) # ctresalloc links against CMakeLib and CTestLib, which means it can't be built diff --git a/Tests/RunCMake/CUDA_architectures/CMakeLists.txt b/Tests/RunCMake/CUDA_architectures/CMakeLists.txt new file mode 100644 index 0000000..d8200fc --- /dev/null +++ b/Tests/RunCMake/CUDA_architectures/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.22) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CUDA_architectures/RunCMakeTest.cmake b/Tests/RunCMake/CUDA_architectures/RunCMakeTest.cmake new file mode 100644 index 0000000..cbbf57c --- /dev/null +++ b/Tests/RunCMake/CUDA_architectures/RunCMakeTest.cmake @@ -0,0 +1,4 @@ +include(RunCMake) + +run_cmake(architectures-empty) +run_cmake(architectures-invalid) diff --git a/Tests/RunCMake/CUDA_architectures/architectures-empty-result.txt b/Tests/RunCMake/CUDA_architectures/architectures-empty-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CUDA_architectures/architectures-empty-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CUDA_architectures/architectures-empty-stderr.txt b/Tests/RunCMake/CUDA_architectures/architectures-empty-stderr.txt new file mode 100644 index 0000000..39640fa --- /dev/null +++ b/Tests/RunCMake/CUDA_architectures/architectures-empty-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at .*/Modules/CMakeDetermineCUDACompiler\.cmake:[0-9]+ \(message\): + CMAKE_CUDA_ARCHITECTURES must be valid if set\. +Call Stack \(most recent call first\): + architectures-empty\.cmake:2 \(enable_language\) + CMakeLists\.txt:3 \(include\) diff --git a/Tests/RunCMake/CUDA_architectures/architectures-empty.cmake b/Tests/RunCMake/CUDA_architectures/architectures-empty.cmake new file mode 100644 index 0000000..4915248 --- /dev/null +++ b/Tests/RunCMake/CUDA_architectures/architectures-empty.cmake @@ -0,0 +1,2 @@ +set(CMAKE_CUDA_ARCHITECTURES "") +enable_language(CUDA) diff --git a/Tests/RunCMake/CUDA_architectures/architectures-invalid-result.txt b/Tests/RunCMake/CUDA_architectures/architectures-invalid-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CUDA_architectures/architectures-invalid-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CUDA_architectures/architectures-invalid-stderr.txt b/Tests/RunCMake/CUDA_architectures/architectures-invalid-stderr.txt new file mode 100644 index 0000000..7608730 --- /dev/null +++ b/Tests/RunCMake/CUDA_architectures/architectures-invalid-stderr.txt @@ -0,0 +1,5 @@ +^CMake Error at .*/Modules/CMakeDetermineCUDACompiler\.cmake:[0-9]+ \(message\): + CMAKE_CUDA_ARCHITECTURES must be valid if set\. +Call Stack \(most recent call first\): + architectures-invalid\.cmake:2 \(enable_language\) + CMakeLists\.txt:3 \(include\)$ diff --git a/Tests/RunCMake/CUDA_architectures/architectures-invalid.cmake b/Tests/RunCMake/CUDA_architectures/architectures-invalid.cmake new file mode 100644 index 0000000..e5c8628 --- /dev/null +++ b/Tests/RunCMake/CUDA_architectures/architectures-invalid.cmake @@ -0,0 +1,2 @@ +set(CMAKE_CUDA_ARCHITECTURES "invalid") +enable_language(CUDA) |