diff options
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CudaOnly/Architecture/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/CudaOnly/Architecture/main.cu | 9 | ||||
-rw-r--r-- | Tests/CudaOnly/CMakeLists.txt | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0104/CMP0104-Common.cmake | 2 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0104/CMP0104-NEW.cmake | 6 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0104/CMP0104-OLD.cmake | 12 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0104/CMP0104-WARN-stderr.txt | 8 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0104/CMP0104-WARN.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0104/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0104/RunCMakeTest.cmake | 5 | ||||
-rw-r--r-- | Tests/RunCMake/CMP0104/main.cu | 3 | ||||
-rw-r--r-- | Tests/RunCMake/CMakeLists.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/CompilerLauncher/CUDA-common.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake | 1 | ||||
-rw-r--r-- | Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt | 1 |
15 files changed, 61 insertions, 0 deletions
diff --git a/Tests/CudaOnly/Architecture/CMakeLists.txt b/Tests/CudaOnly/Architecture/CMakeLists.txt new file mode 100644 index 0000000..7270b56 --- /dev/null +++ b/Tests/CudaOnly/Architecture/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_minimum_required(VERSION 3.17) +project(Architecture CUDA) + +set(CMAKE_CUDA_ARCHITECTURES 52) +add_executable(Architecture main.cu) diff --git a/Tests/CudaOnly/Architecture/main.cu b/Tests/CudaOnly/Architecture/main.cu new file mode 100644 index 0000000..8c817d5 --- /dev/null +++ b/Tests/CudaOnly/Architecture/main.cu @@ -0,0 +1,9 @@ +#ifdef __CUDA_ARCH__ +# if __CUDA_ARCH__ != 520 +# error "Passed architecture 52, but got something else." +# endif +#endif + +int main() +{ +} diff --git a/Tests/CudaOnly/CMakeLists.txt b/Tests/CudaOnly/CMakeLists.txt index cc1ee1a..0b2628c 100644 --- a/Tests/CudaOnly/CMakeLists.txt +++ b/Tests/CudaOnly/CMakeLists.txt @@ -1,4 +1,5 @@ +ADD_TEST_MACRO(CudaOnly.Architecture Architecture) ADD_TEST_MACRO(CudaOnly.CircularLinkLine CudaOnlyCircularLinkLine) ADD_TEST_MACRO(CudaOnly.EnableStandard CudaOnlyEnableStandard) ADD_TEST_MACRO(CudaOnly.ExportPTX CudaOnlyExportPTX) diff --git a/Tests/RunCMake/CMP0104/CMP0104-Common.cmake b/Tests/RunCMake/CMP0104/CMP0104-Common.cmake new file mode 100644 index 0000000..b3568f1 --- /dev/null +++ b/Tests/RunCMake/CMP0104/CMP0104-Common.cmake @@ -0,0 +1,2 @@ +enable_language(CUDA) +add_library(cuda main.cu) diff --git a/Tests/RunCMake/CMP0104/CMP0104-NEW.cmake b/Tests/RunCMake/CMP0104/CMP0104-NEW.cmake new file mode 100644 index 0000000..732ab77 --- /dev/null +++ b/Tests/RunCMake/CMP0104/CMP0104-NEW.cmake @@ -0,0 +1,6 @@ +cmake_policy(SET CMP0104 NEW) +include(CMP0104-Common.cmake) + +if(NOT CMAKE_CUDA_ARCHITECTURES) + message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES is empty with CMP0104 enabled.") +endif() diff --git a/Tests/RunCMake/CMP0104/CMP0104-OLD.cmake b/Tests/RunCMake/CMP0104/CMP0104-OLD.cmake new file mode 100644 index 0000000..415eecc --- /dev/null +++ b/Tests/RunCMake/CMP0104/CMP0104-OLD.cmake @@ -0,0 +1,12 @@ +cmake_policy(SET CMP0104 OLD) +include(CMP0104-Common.cmake) + +if(CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") + if(CMAKE_CUDA_ARCHITECTURES) + message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES isn't empty for NVIDIA with CMP0104 OLD.") + endif() +else(NOT CMAKE_CUDA_COMPILER_ID STREQUAL "Unknown") + if(NOT CMAKE_CUDA_ARCHITECTURES) + message(FATAL_ERROR "CMAKE_CUDA_ARCHITECTURES isn't non-empty for non-NVIDIA with CMP0104 OLD.") + endif() +endif() diff --git a/Tests/RunCMake/CMP0104/CMP0104-WARN-stderr.txt b/Tests/RunCMake/CMP0104/CMP0104-WARN-stderr.txt new file mode 100644 index 0000000..2c9b7d7 --- /dev/null +++ b/Tests/RunCMake/CMP0104/CMP0104-WARN-stderr.txt @@ -0,0 +1,8 @@ +CMake Warning \(dev\) in CMakeLists.txt: + Policy CMP0104 is not set: CMAKE_CUDA_ARCHITECTURES now detected for NVCC, + empty CUDA_ARCHITECTURES not allowed. Run "cmake --help-policy CMP0104" + for policy details. Use the cmake_policy command to set the policy and + suppress this warning. + + CUDA_ARCHITECTURES is empty for target "cuda". +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0104/CMP0104-WARN.cmake b/Tests/RunCMake/CMP0104/CMP0104-WARN.cmake new file mode 100644 index 0000000..841d0a8 --- /dev/null +++ b/Tests/RunCMake/CMP0104/CMP0104-WARN.cmake @@ -0,0 +1 @@ +include(CMP0104-Common.cmake) diff --git a/Tests/RunCMake/CMP0104/CMakeLists.txt b/Tests/RunCMake/CMP0104/CMakeLists.txt new file mode 100644 index 0000000..2632ffa --- /dev/null +++ b/Tests/RunCMake/CMP0104/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.16) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0104/RunCMakeTest.cmake b/Tests/RunCMake/CMP0104/RunCMakeTest.cmake new file mode 100644 index 0000000..bc8e1b1 --- /dev/null +++ b/Tests/RunCMake/CMP0104/RunCMakeTest.cmake @@ -0,0 +1,5 @@ +include(RunCMake) + +run_cmake(CMP0104-OLD) +run_cmake(CMP0104-NEW) +run_cmake(CMP0104-WARN) diff --git a/Tests/RunCMake/CMP0104/main.cu b/Tests/RunCMake/CMP0104/main.cu new file mode 100644 index 0000000..5047a34 --- /dev/null +++ b/Tests/RunCMake/CMP0104/main.cu @@ -0,0 +1,3 @@ +int main() +{ +} diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index 2a4af3e..34e1fbc 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -116,6 +116,9 @@ endif() add_RunCMake_test(CMP0069) add_RunCMake_test(CMP0081) add_RunCMake_test(CMP0102) +if(CMake_TEST_CUDA) + add_RunCMake_test(CMP0104) +endif() # The test for Policy 65 requires the use of the # CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS variable, which both the VS and Xcode diff --git a/Tests/RunCMake/CompilerLauncher/CUDA-common.cmake b/Tests/RunCMake/CompilerLauncher/CUDA-common.cmake index 6f7fc86..ca25b2a 100644 --- a/Tests/RunCMake/CompilerLauncher/CUDA-common.cmake +++ b/Tests/RunCMake/CompilerLauncher/CUDA-common.cmake @@ -1,3 +1,4 @@ +cmake_policy(SET CMP0104 NEW) enable_language(CUDA) set(CMAKE_VERBOSE_MAKEFILE TRUE) add_executable(main main.cu) diff --git a/Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake b/Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake index 2e9b1cb..00d8a1b 100644 --- a/Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake +++ b/Tests/RunCMake/NinjaMultiConfig/CudaSimple.cmake @@ -1,3 +1,4 @@ +cmake_policy(SET CMP0104 NEW) enable_language(CUDA) file(TOUCH ${CMAKE_BINARY_DIR}/empty.cmake) diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt index 9a1e027..7ffd522 100644 --- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt +++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt @@ -29,6 +29,7 @@ \* CMP0083 \* CMP0095 \* CMP0099 + \* CMP0104 Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) |