Files
CMake/Tests/RunCMake/CMP0104/CMP0104-OLD.cmake
T
Raul Tambre c57541d874 CUDA: Fix tests with CUDAARCHS set
With CUDAARCHS there's the possibility of tests being run with multiple
architectures or having CMAKE_CUDA_ARCHITECTURES set with NVCC despite CMP0104
being OLD.
Fix a few tests to work properly in such cases.
2020-11-30 17:57:27 +02:00

15 lines
467 B
CMake

set(ENV{CUDAARCHS})
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()