summaryrefslogtreecommitdiff
path: root/Modules/CMakeCUDAInformation.cmake
diff options
context:
space:
mode:
authorRobert Maynard <rmaynard@nvidia.com>2021-09-17 16:39:13 -0400
committerunknown <rmaynard@nvidia.com>2021-10-20 11:18:06 -0400
commit61b9764b03517276e99584de02d52ceefa5689ec (patch)
tree663e5dee6f66a2ef958002b209437b659ad02dca /Modules/CMakeCUDAInformation.cmake
parent3b5e1b53eae726bb4105240143354270df4495e3 (diff)
downloadcmake-61b9764b03517276e99584de02d52ceefa5689ec.tar.gz
CUDA: Allow both CUDA_SEPARABLE_COMPILATION and CUDA_PTX_COMPILATION
The target properties `CUDA_SEPARABLE_COMPILATION` and `CUDA_PTX_COMPILATION` now aren't mutually exclusive and can now be used together on the same target.
Diffstat (limited to 'Modules/CMakeCUDAInformation.cmake')
-rw-r--r--Modules/CMakeCUDAInformation.cmake19
1 files changed, 3 insertions, 16 deletions
diff --git a/Modules/CMakeCUDAInformation.cmake b/Modules/CMakeCUDAInformation.cmake
index e9cfed607b..94b67dc796 100644
--- a/Modules/CMakeCUDAInformation.cmake
+++ b/Modules/CMakeCUDAInformation.cmake
@@ -160,22 +160,9 @@ if(NOT DEFINED CMAKE_CUDA_ARCHIVE_FINISH)
set(CMAKE_CUDA_ARCHIVE_FINISH "<CMAKE_RANLIB> <TARGET>")
endif()
-#Specify how to compile when ptx has been requested
-if(NOT CMAKE_CUDA_COMPILE_PTX_COMPILATION)
- set(CMAKE_CUDA_COMPILE_PTX_COMPILATION
- "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <DEFINES> <INCLUDES> <FLAGS> ${_CMAKE_COMPILE_AS_CUDA_FLAG} ${_CMAKE_CUDA_PTX_FLAG} <SOURCE> -o <OBJECT>")
-endif()
-
-#Specify how to compile when separable compilation has been requested
-if(NOT CMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION)
- set(CMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION
- "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <DEFINES> <INCLUDES> <FLAGS> ${_CMAKE_COMPILE_AS_CUDA_FLAG} ${_CMAKE_CUDA_DEVICE_CODE} <SOURCE> -o <OBJECT>")
-endif()
-
-#Specify how to compile when whole compilation has been requested
-if(NOT CMAKE_CUDA_COMPILE_WHOLE_COMPILATION)
- set(CMAKE_CUDA_COMPILE_WHOLE_COMPILATION
- "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <DEFINES> <INCLUDES> <FLAGS> ${_CMAKE_COMPILE_AS_CUDA_FLAG} -c <SOURCE> -o <OBJECT>")
+if(NOT CMAKE_CUDA_COMPILE_OBJECT)
+ set(CMAKE_CUDA_COMPILE_OBJECT
+ "<CMAKE_CUDA_COMPILER> ${_CMAKE_CUDA_EXTRA_FLAGS} <DEFINES> <INCLUDES> <FLAGS> ${_CMAKE_COMPILE_AS_CUDA_FLAG} <CUDA_COMPILE_MODE> <SOURCE> -o <OBJECT>")
endif()
# compile a cu file into an executable