diff options
author | Brad King <brad.king@kitware.com> | 2017-04-21 12:57:55 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-04-21 12:57:59 (GMT) |
commit | 1d8f0f918178c50e8ef66b01546f34cd2a126a6d (patch) | |
tree | 04d8830fb1d4b5338e9afabcb8ac3b4bb134fb05 /Source/cmLocalVisualStudioGenerator.cxx | |
parent | 0ad8e4ea658ed992841c81dca2c5eb31abc40983 (diff) | |
parent | 23691d789e198c228e5c2bb7016b3b1194fd0635 (diff) | |
download | CMake-1d8f0f918178c50e8ef66b01546f34cd2a126a6d.zip CMake-1d8f0f918178c50e8ef66b01546f34cd2a126a6d.tar.gz CMake-1d8f0f918178c50e8ef66b01546f34cd2a126a6d.tar.bz2 |
Merge topic 'enable_ptx_compilation'
23691d78 CUDA: Allow sources to be compiled to .ptx files
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !725
Diffstat (limited to 'Source/cmLocalVisualStudioGenerator.cxx')
-rw-r--r-- | Source/cmLocalVisualStudioGenerator.cxx | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx index 3d7b60b..41025af 100644 --- a/Source/cmLocalVisualStudioGenerator.cxx +++ b/Source/cmLocalVisualStudioGenerator.cxx @@ -32,6 +32,7 @@ void cmLocalVisualStudioGenerator::ComputeObjectFilenames( std::map<cmSourceFile const*, std::string>& mapping, cmGeneratorTarget const* gt) { + char const* custom_ext = gt->GetCustomObjectExtension(); std::string dir_max = this->ComputeLongestObjectDirectory(gt); // Count the number of object files with each name. Note that @@ -44,7 +45,12 @@ void cmLocalVisualStudioGenerator::ComputeObjectFilenames( cmSourceFile const* sf = si->first; std::string objectNameLower = cmSystemTools::LowerCase( cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath())); - objectNameLower += this->GlobalGenerator->GetLanguageOutputExtension(*sf); + if (custom_ext) { + objectNameLower += custom_ext; + } else { + objectNameLower += + this->GlobalGenerator->GetLanguageOutputExtension(*sf); + } counts[objectNameLower] += 1; } @@ -57,10 +63,16 @@ void cmLocalVisualStudioGenerator::ComputeObjectFilenames( cmSourceFile const* sf = si->first; std::string objectName = cmSystemTools::GetFilenameWithoutLastExtension(sf->GetFullPath()); - objectName += this->GlobalGenerator->GetLanguageOutputExtension(*sf); + if (custom_ext) { + objectName += custom_ext; + } else { + objectName += this->GlobalGenerator->GetLanguageOutputExtension(*sf); + } if (counts[cmSystemTools::LowerCase(objectName)] > 1) { const_cast<cmGeneratorTarget*>(gt)->AddExplicitObjectName(sf); - objectName = this->GetObjectFileNameWithoutTarget(*sf, dir_max); + bool keptSourceExtension; + objectName = this->GetObjectFileNameWithoutTarget( + *sf, dir_max, &keptSourceExtension, custom_ext); } si->second = objectName; } |