|
|
@@ -1018,7 +1018,17 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
|
|
|
|
|
|
if(CUDA_PROPAGATE_HOST_FLAGS)
|
|
|
# nvcc chokes on -g3 in versions previous to 3.0, so replace it with -g
|
|
|
- if(CMAKE_COMPILER_IS_GNUCC AND CUDA_VERSION VERSION_LESS "3.0")
|
|
|
+ set(_cuda_fix_g3 FALSE)
|
|
|
+
|
|
|
+ if(CMAKE_COMPILER_IS_GNUCC)
|
|
|
+ if (CUDA_VERSION VERSION_LESS "3.0" OR
|
|
|
+ CUDA_VERSION VERSION_EQUAL "4.1" OR
|
|
|
+ CUDA_VERSION VERSION_EQUAL "4.2"
|
|
|
+ )
|
|
|
+ set(_cuda_fix_g3 TRUE)
|
|
|
+ endif()
|
|
|
+ endif()
|
|
|
+ if(_cuda_fix_g3)
|
|
|
string(REPLACE "-g3" "-g" _cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}")
|
|
|
else()
|
|
|
set(_cuda_C_FLAGS "${CMAKE_${CUDA_C_OR_CXX}_FLAGS_${config_upper}}")
|