Allow -g3 for CUDA v3.0+.

In versions of the CUDA toolkit previous to version 3.0 the use of -g3 would cause
compilation errors.  This was fixed in version 3.0.
This commit is contained in:
James Bigler 2010-10-04 16:42:21 -06:00
parent 5eca3dd0f0
commit 6916f8dba7
1 changed files with 2 additions and 2 deletions

View File

@ -941,8 +941,8 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
# we convert the strings to lists (like we want). # we convert the strings to lists (like we want).
if(CUDA_PROPAGATE_HOST_FLAGS) if(CUDA_PROPAGATE_HOST_FLAGS)
# nvcc chokes on -g3, so replace it with -g # nvcc chokes on -g3 in versions previous to 3.0, so replace it with -g
if(CMAKE_COMPILER_IS_GNUCC) if(CMAKE_COMPILER_IS_GNUCC AND CUDA_VERSION VERSION_LESS "3.0")
string(REPLACE "-g3" "-g" _cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") string(REPLACE "-g3" "-g" _cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}")
else() else()
set(_cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}") set(_cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}")