Define __CUDACC__ during dependency scanning, since NVCC doesn't.
This commit is contained in:
parent
addeec72e3
commit
d2d3672f1c
|
@ -164,11 +164,18 @@ if(CUDA_VERSION VERSION_LESS "3.0")
|
||||||
cmake_policy(POP)
|
cmake_policy(POP)
|
||||||
endif()
|
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
|
# Generate the dependency file
|
||||||
cuda_execute_process(
|
cuda_execute_process(
|
||||||
"Generating dependency file: ${NVCC_generated_dependency_file}"
|
"Generating dependency file: ${NVCC_generated_dependency_file}"
|
||||||
COMMAND "${CUDA_NVCC_EXECUTABLE}"
|
COMMAND "${CUDA_NVCC_EXECUTABLE}"
|
||||||
-M
|
-M
|
||||||
|
${CUDACC_DEFINE}
|
||||||
"${source_file}"
|
"${source_file}"
|
||||||
-o "${NVCC_generated_dependency_file}"
|
-o "${NVCC_generated_dependency_file}"
|
||||||
${CCBIN}
|
${CCBIN}
|
||||||
|
|
Loading…
Reference in New Issue