diff options
author | James Bigler <jbigler@nvidia.com> | 2010-01-28 17:58:22 (GMT) |
---|---|---|
committer | James Bigler <jbigler@nvidia.com> | 2010-01-28 17:58:22 (GMT) |
commit | d2d3672f1c0b4bb2a2ca25aa1ca46d2edef436a8 (patch) | |
tree | b7bc64eb0e5c616d4919f7d1a146fda9979360eb | |
parent | addeec72e3b6253554b67a2ab354bda8de8661f4 (diff) | |
download | CMake-d2d3672f1c0b4bb2a2ca25aa1ca46d2edef436a8.zip CMake-d2d3672f1c0b4bb2a2ca25aa1ca46d2edef436a8.tar.gz CMake-d2d3672f1c0b4bb2a2ca25aa1ca46d2edef436a8.tar.bz2 |
Define __CUDACC__ during dependency scanning, since NVCC doesn't.
-rw-r--r-- | Modules/FindCUDA/run_nvcc.cmake | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/FindCUDA/run_nvcc.cmake b/Modules/FindCUDA/run_nvcc.cmake index 31bd74e..7349da3 100644 --- a/Modules/FindCUDA/run_nvcc.cmake +++ b/Modules/FindCUDA/run_nvcc.cmake @@ -164,11 +164,18 @@ if(CUDA_VERSION VERSION_LESS "3.0") cmake_policy(POP) endif() +# nvcc doesn't define __CUDACC__ for some reason when generating dependency files. This +# can cause incorrect dependencies when #including files based on this macro which is +# defined in the generating passes of nvcc invokation. We will go ahead and manually +# define this for now until a future version fixes this bug. +set(CUDACC_DEFINE -D__CUDACC__) + # Generate the dependency file cuda_execute_process( "Generating dependency file: ${NVCC_generated_dependency_file}" COMMAND "${CUDA_NVCC_EXECUTABLE}" -M + ${CUDACC_DEFINE} "${source_file}" -o "${NVCC_generated_dependency_file}" ${CCBIN} |