diff --git a/cmake/cuda.cmake b/cmake/cuda.cmake index 45a4b132880525fb4450cec0dc92266c5962b782..cdcbb797926525a9cab770e889cc5edc6d01aaa3 100644 --- a/cmake/cuda.cmake +++ b/cmake/cuda.cmake @@ -167,12 +167,8 @@ select_nvcc_arch_flags(NVCC_FLAGS_EXTRA) list(APPEND CUDA_NVCC_FLAGS ${NVCC_FLAGS_EXTRA}) message(STATUS "Added CUDA NVCC flags for: ${NVCC_FLAGS_EXTRA_readable}") -if (WIN32) - set(CUDA_PROPAGATE_HOST_FLAGS ON) -else (WIN32) - # Set C++11 support - set(CUDA_PROPAGATE_HOST_FLAGS OFF) -endif (WIN32) +# Set C++11 support +set(CUDA_PROPAGATE_HOST_FLAGS OFF) # Release/Debug flags set by cmake. Such as -O3 -g -DNDEBUG etc. # So, don't set these flags here. @@ -203,10 +199,12 @@ elseif(CMAKE_BUILD_TYPE STREQUAL "MinSizeRel") list(APPEND CUDA_NVCC_FLAGS ${CMAKE_CXX_FLAGS_RELEASE}) endif() else(NOT WIN32) -if(CMAKE_BUILD_TYPE STREQUAL "Release") +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + list(APPEND CUDA_NVCC_FLAGS "-g -lineinfo -G") +elseif(CMAKE_BUILD_TYPE STREQUAL "Release") list(APPEND CUDA_NVCC_FLAGS "-O3 -DNDEBUG") else() - message(FATAL "Windows only support Release build now. Please set visual studio build type to Release, x64 build.") + message(FATAL "Windows only support Release or Debug build now. Please set visual studio build type to Release/Debug, x64 build.") endif() endif(NOT WIN32)