summaryrefslogtreecommitdiffstats
path: root/Source/cmLocalGenerator.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/cmLocalGenerator.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/cmLocalGenerator.cxx')
-rw-r--r--Source/cmLocalGenerator.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx
index 93db192..424ab6f 100644
--- a/Source/cmLocalGenerator.cxx
+++ b/Source/cmLocalGenerator.cxx
@@ -2162,7 +2162,7 @@ bool cmLocalGenerator::IsNMake() const
std::string cmLocalGenerator::GetObjectFileNameWithoutTarget(
const cmSourceFile& source, std::string const& dir_max,
- bool* hasSourceExtension)
+ bool* hasSourceExtension, char const* customOutputExtension)
{
// Construct the object file name using the full path to the source
// file which is its only unique identification.
@@ -2223,7 +2223,7 @@ std::string cmLocalGenerator::GetObjectFileNameWithoutTarget(
}
// Remove the source extension if it is to be replaced.
- if (replaceExt) {
+ if (replaceExt || customOutputExtension) {
keptSourceExtension = false;
std::string::size_type dot_pos = objectName.rfind('.');
if (dot_pos != std::string::npos) {
@@ -2232,7 +2232,11 @@ std::string cmLocalGenerator::GetObjectFileNameWithoutTarget(
}
// Store the new extension.
- objectName += this->GlobalGenerator->GetLanguageOutputExtension(source);
+ if (customOutputExtension) {
+ objectName += customOutputExtension;
+ } else {
+ objectName += this->GlobalGenerator->GetLanguageOutputExtension(source);
+ }
}
if (hasSourceExtension) {
*hasSourceExtension = keptSourceExtension;