summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.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/cmTarget.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/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 0b1bb06..a1e5a47 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -940,6 +940,14 @@ void cmTarget::SetProperty(const std::string& prop, const char* value)
} else if (cmHasLiteralPrefix(prop, "IMPORTED_LIBNAME") &&
!this->CheckImportedLibName(prop, value ? value : "")) {
/* error was reported by check method */
+ } else if (prop == "CUDA_PTX_COMPILATION" &&
+ this->GetType() != cmStateEnums::OBJECT_LIBRARY) {
+ std::ostringstream e;
+ e << "CUDA_PTX_COMPILATION property can only be applied to OBJECT "
+ "targets (\""
+ << this->Name << "\")\n";
+ this->Makefile->IssueMessage(cmake::FATAL_ERROR, e.str());
+ return;
} else {
this->Properties.SetProperty(prop, value);
}