summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalVisualStudioGenerator.cxx
diff options
context:
space:
mode:
authorRobert Maynard <robert.maynard@kitware.com>2017-03-23 13:31:45 (GMT)
committerBrad King <brad.king@kitware.com>2017-04-20 17:25:38 (GMT)
commit23691d789e198c228e5c2bb7016b3b1194fd0635 (patch)
treef193265a71bd50a5a8df8f6e5a4c562dbdc375f3 /Source/cmLocalVisualStudioGenerator.cxx
parent44f0d2d9913595e214048b6d5a2b9ab2e9d1cf46 (diff)
downloadCMake-23691d789e198c228e5c2bb7016b3b1194fd0635.zip
CMake-23691d789e198c228e5c2bb7016b3b1194fd0635.tar.gz
CMake-23691d789e198c228e5c2bb7016b3b1194fd0635.tar.bz2
CUDA: Allow sources to be compiled to .ptx files
When the target property `CUDA_PTX_COMPILATION` is enabled CUDA OBJECT libraries will generate ptx files instead of object files.
Diffstat (limited to 'Source/cmLocalVisualStudioGenerator.cxx')
-rw-r--r--Source/cmLocalVisualStudioGenerator.cxx18
1 files changed, 15 insertions, 3 deletions
diff --git a/Source/cmLocalVisualStudioGenerator.cxx b/Source/cmLocalVisualStudioGenerator.cxx
index e20fe50..60235d6 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;
}