CUDA: Enable header dependency scanning.
This commit is contained in:
parent
ec6ce62335
commit
a92f8d9616
@ -85,7 +85,20 @@ endif()
|
|||||||
# compile a cu file into an object file
|
# compile a cu file into an object file
|
||||||
if(NOT CMAKE_CUDA_COMPILE_OBJECT)
|
if(NOT CMAKE_CUDA_COMPILE_OBJECT)
|
||||||
set(CMAKE_CUDA_COMPILE_OBJECT
|
set(CMAKE_CUDA_COMPILE_OBJECT
|
||||||
"<CMAKE_CUDA_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -o <OBJECT> -x cu -c <SOURCE>")
|
"<CMAKE_CUDA_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -x cu -c <SOURCE> -o <OBJECT>")
|
||||||
|
|
||||||
|
#The Ninja generator uses the make file dependency files to determine what
|
||||||
|
#files need to be recompiled. Unfortunately, nvcc doesn't support building
|
||||||
|
#a source file and generating the dependencies of said file in a single
|
||||||
|
#invocation. Instead we have to state that you need to chain two commands.
|
||||||
|
#
|
||||||
|
#The makefile generators uses the custom CMake dependency scanner, and thus
|
||||||
|
#it is exempt from this logic.
|
||||||
|
if(CMAKE_GENERATOR STREQUAL "Ninja")
|
||||||
|
list(APPEND CMAKE_CUDA_COMPILE_OBJECT
|
||||||
|
"<CMAKE_CUDA_COMPILER> <DEFINES> <INCLUDES> <FLAGS> -x cu -M <SOURCE> -MT <OBJECT> -o $DEP_FILE")
|
||||||
|
endif()
|
||||||
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# compile a cu file into an executable
|
# compile a cu file into an executable
|
||||||
|
@ -1458,7 +1458,8 @@ bool cmLocalUnixMakefileGenerator3::ScanDependencies(
|
|||||||
|
|
||||||
// Create the scanner for this language
|
// Create the scanner for this language
|
||||||
cmDepends* scanner = CM_NULLPTR;
|
cmDepends* scanner = CM_NULLPTR;
|
||||||
if (lang == "C" || lang == "CXX" || lang == "RC" || lang == "ASM") {
|
if (lang == "C" || lang == "CXX" || lang == "RC" || lang == "ASM" ||
|
||||||
|
lang == "CUDA") {
|
||||||
// TODO: Handle RC (resource files) dependencies correctly.
|
// TODO: Handle RC (resource files) dependencies correctly.
|
||||||
scanner = new cmDependsC(this, targetDir, lang, &validDeps);
|
scanner = new cmDependsC(this, targetDir, lang, &validDeps);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user