summaryrefslogtreecommitdiffstats
path: root/Source/cmGeneratorTarget.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/cmGeneratorTarget.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/cmGeneratorTarget.cxx')
-rw-r--r--Source/cmGeneratorTarget.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 2799505..5161f09 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -528,6 +528,18 @@ const std::string& cmGeneratorTarget::GetObjectName(cmSourceFile const* file)
return this->Objects[file];
}
+const char* cmGeneratorTarget::GetCustomObjectExtension() const
+{
+ static std::string extension;
+ const bool has_ptx_extension =
+ this->GetPropertyAsBool("CUDA_PTX_COMPILATION");
+ if (has_ptx_extension) {
+ extension = ".ptx";
+ return extension.c_str();
+ }
+ return CM_NULLPTR;
+}
+
void cmGeneratorTarget::AddExplicitObjectName(cmSourceFile const* sf)
{
this->ExplicitObjectName.insert(sf);