summaryrefslogtreecommitdiffstats
path: root/Modules/FindCUDA
diff options
context:
space:
mode:
authorJames Bigler <jbigler@nvidia.com>2009-11-30 22:05:18 (GMT)
committerJames Bigler <jbigler@nvidia.com>2009-11-30 22:05:18 (GMT)
commitc9235c0159a75b55aae3e14bce852dd92b90a0f9 (patch)
treeed2ca3132e5022acdcbb601522cdf575e1b2379b /Modules/FindCUDA
parent88eefaced14bee4bffb7f1dd1c5a2aa02bc97101 (diff)
downloadCMake-c9235c0159a75b55aae3e14bce852dd92b90a0f9.zip
CMake-c9235c0159a75b55aae3e14bce852dd92b90a0f9.tar.gz
CMake-c9235c0159a75b55aae3e14bce852dd92b90a0f9.tar.bz2
Don't allow -G -M on CUDA versions less than 3.0.
Diffstat (limited to 'Modules/FindCUDA')
-rw-r--r--Modules/FindCUDA/run_nvcc.cmake16
1 files changed, 15 insertions, 1 deletions
diff --git a/Modules/FindCUDA/run_nvcc.cmake b/Modules/FindCUDA/run_nvcc.cmake
index 4a9a7d4..d7fde75 100644
--- a/Modules/FindCUDA/run_nvcc.cmake
+++ b/Modules/FindCUDA/run_nvcc.cmake
@@ -150,12 +150,26 @@ cuda_execute_process(
COMMAND "${CMAKE_COMMAND}" -E remove "${generated_file}"
)
+# For CUDA 2.3 and below, -G -M doesn't work, so remove the -G flag
+# for dependency generation and hope for the best.
+set(depends_CUDA_NVCC_FLAGS "${CUDA_NVCC_FLAGS}")
+set(CUDA_VERSION @CUDA_VERSION@)
+if(CUDA_VERSION VERSION_LESS "3.0")
+ cmake_policy(PUSH)
+ # CMake policy 0007 NEW states that empty list elements are not
+ # ignored. I'm just setting it to avoid the warning that's printed.
+ cmake_policy(SET CMP0007 NEW)
+ # Note that this will remove all occurances of -G.
+ list(REMOVE_ITEM depends_CUDA_NVCC_FLAGS "-G")
+ cmake_policy(POP)
+endif()
+
# Generate the dependency file
cuda_execute_process(
"Generating dependency file: ${NVCC_generated_dependency_file}"
COMMAND "${CUDA_NVCC_EXECUTABLE}"
"${source_file}"
- ${CUDA_NVCC_FLAGS}
+ ${depends_CUDA_NVCC_FLAGS}
${nvcc_flags}
${CCBIN}
${nvcc_host_compiler_flags}