Merge topic 'msvc_cuda_files_use_consistent_obj_names'

fa583869 CUDA: Use MSVC default pattern for naming object files

Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !1722
This commit is contained in:
Brad King
2018-01-31 13:36:18 +00:00
committed by Kitware Robot
7 changed files with 51 additions and 26 deletions
+14 -3
View File
@@ -2078,9 +2078,15 @@ bool cmVisualStudio10TargetGenerator::OutputSourceSpecificFlags(
(*this->BuildFileStream) << firstString;
firstString = "";
hasFlags = true;
this->WriteString("<ObjectFileName>", 3);
(*this->BuildFileStream) << "$(IntDir)/" << objectName
<< "</ObjectFileName>\n";
if (lang == "CUDA") {
this->WriteString("<CompileOut>", 3);
(*this->BuildFileStream) << "$(IntDir)/" << objectName
<< "</CompileOut>\n";
} else {
this->WriteString("<ObjectFileName>", 3);
(*this->BuildFileStream) << "$(IntDir)/" << objectName
<< "</ObjectFileName>\n";
}
}
for (std::string const& config : this->Configurations) {
std::string configUpper = cmSystemTools::UpperCase(config);
@@ -2688,6 +2694,11 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions(
cudaOptions.AddFlag("GPUDebugInfo", "false");
}
// The extension on object libraries the CUDA gives isn't
// consistent with how MSVC generates object libraries for C+, so set
// the default to not have any extension
cudaOptions.AddFlag("CompileOut", "$(IntDir)%(Filename).obj");
bool notPtx = true;
if (this->GeneratorTarget->GetPropertyAsBool("CUDA_SEPARABLE_COMPILATION")) {
cudaOptions.AddFlag("GenerateRelocatableDeviceCode", "true");