diff options
author | David Cole <david.cole@kitware.com> | 2012-08-24 18:23:21 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-08-24 18:23:21 (GMT) |
commit | 6dab13c56e731d3d8ed6a751a6e0735835acc76f (patch) | |
tree | 945ce94558647edb96512cc465ed86b2ad7ec57e /Modules/FindCUDA.cmake | |
parent | 19d9f5908b541a3d61361cbfd1a315ac3f512543 (diff) | |
parent | a20c41d0328f6a4557789bb382c9b3f69b76ea30 (diff) | |
download | CMake-6dab13c56e731d3d8ed6a751a6e0735835acc76f.zip CMake-6dab13c56e731d3d8ed6a751a6e0735835acc76f.tar.gz CMake-6dab13c56e731d3d8ed6a751a6e0735835acc76f.tar.bz2 |
Merge topic 'topics/FindCUDA/Fix-g3-again'
a20c41d Replace -g3 with -g for CUDA 4.1 and 4.2 in addition to CUDA < 3.0.
Diffstat (limited to 'Modules/FindCUDA.cmake')
-rw-r--r-- | Modules/FindCUDA.cmake | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/Modules/FindCUDA.cmake b/Modules/FindCUDA.cmake index 6a6be47..c7a387a 100644 --- a/Modules/FindCUDA.cmake +++ b/Modules/FindCUDA.cmake @@ -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}}") |