mirror of
https://github.com/reactos/CMake.git
synced 2024-11-24 03:59:58 +00:00
Merge branch 'ninja_cuda_export_compile_commands_support' into release-3.9
This commit is contained in:
commit
9d9085ab36
@ -104,7 +104,9 @@ include(CMakeCommonLanguageInclude)
|
||||
# now define the following rules:
|
||||
# CMAKE_CUDA_CREATE_SHARED_LIBRARY
|
||||
# CMAKE_CUDA_CREATE_SHARED_MODULE
|
||||
# CMAKE_CUDA_COMPILE_OBJECT
|
||||
# CMAKE_CUDA_COMPILE_WHOLE_COMPILATION
|
||||
# CMAKE_CUDA_COMPILE_PTX_COMPILATION
|
||||
# CMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION
|
||||
# CMAKE_CUDA_LINK_EXECUTABLE
|
||||
|
||||
if(CMAKE_CUDA_HOST_COMPILER)
|
||||
|
@ -1064,13 +1064,28 @@ void cmNinjaTargetGenerator::ExportObjectCompileCommand(
|
||||
compileObjectVars.Includes = includes.c_str();
|
||||
|
||||
// Rule for compiling object file.
|
||||
std::string compileCmdVar = "CMAKE_";
|
||||
compileCmdVar += language;
|
||||
compileCmdVar += "_COMPILE_OBJECT";
|
||||
std::string compileCmd =
|
||||
this->GetMakefile()->GetRequiredDefinition(compileCmdVar);
|
||||
std::vector<std::string> compileCmds;
|
||||
cmSystemTools::ExpandListArgument(compileCmd, compileCmds);
|
||||
if (language == "CUDA") {
|
||||
std::string cmdVar;
|
||||
if (this->GeneratorTarget->GetPropertyAsBool(
|
||||
"CUDA_SEPARABLE_COMPILATION")) {
|
||||
cmdVar = std::string("CMAKE_CUDA_COMPILE_SEPARABLE_COMPILATION");
|
||||
} else if (this->GeneratorTarget->GetPropertyAsBool(
|
||||
"CUDA_PTX_COMPILATION")) {
|
||||
cmdVar = std::string("CMAKE_CUDA_COMPILE_PTX_COMPILATION");
|
||||
} else {
|
||||
cmdVar = std::string("CMAKE_CUDA_COMPILE_WHOLE_COMPILATION");
|
||||
}
|
||||
std::string compileCmd =
|
||||
this->GetMakefile()->GetRequiredDefinition(cmdVar);
|
||||
cmSystemTools::ExpandListArgument(compileCmd, compileCmds);
|
||||
} else {
|
||||
const std::string cmdVar =
|
||||
std::string("CMAKE_") + language + "_COMPILE_OBJECT";
|
||||
std::string compileCmd =
|
||||
this->GetMakefile()->GetRequiredDefinition(cmdVar);
|
||||
cmSystemTools::ExpandListArgument(compileCmd, compileCmds);
|
||||
}
|
||||
|
||||
CM_AUTO_PTR<cmRulePlaceholderExpander> rulePlaceholderExpander(
|
||||
this->GetLocalGenerator()->CreateRulePlaceholderExpander());
|
||||
|
Loading…
Reference in New Issue
Block a user