浏览代码

Merge topic 'FindCUDA-allow-g3'

6916f8d Allow -g3 for CUDA v3.0+.
Brad King 15 年之前
父节点
当前提交
ba3064b584
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      Modules/FindCUDA.cmake

+ 2 - 2
Modules/FindCUDA.cmake

@@ -943,8 +943,8 @@ macro(CUDA_WRAP_SRCS cuda_target format generated_files)
     # we convert the strings to lists (like we want).
 
     if(CUDA_PROPAGATE_HOST_FLAGS)
-      # nvcc chokes on -g3, so replace it with -g
-      if(CMAKE_COMPILER_IS_GNUCC)
+      # 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")
         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}}")