summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2018-01-18 21:05:59 (GMT)
committerRobert Maynard <robert.maynard@kitware.com>2018-01-30 14:14:02 (GMT)
commitfa583869f7e75cdc4c7499f0dbfab2cdac5061bd (patch)
tree325e7e091628ed0e901a800d2ceb5f99cf7a299a /Source
parent142938225e572d846c956f9b1f54d24a960379ab (diff)
downloadCMake-fa583869f7e75cdc4c7499f0dbfab2cdac5061bd.zip
CMake-fa583869f7e75cdc4c7499f0dbfab2cdac5061bd.tar.gz
CMake-fa583869f7e75cdc4c7499f0dbfab2cdac5061bd.tar.bz2
CUDA: Use MSVC default pattern for naming object files
The default that CUDA uses causes failures when you try to embed CUDA obj's into another target.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx17
1 files changed, 14 insertions, 3 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index e15e833..7840e1f 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -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");