summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-03-07 21:07:12 (GMT)
committerBrad King <brad.king@kitware.com>2017-03-10 15:19:56 (GMT)
commitb966f489c1b35cbc897720f1f9b68bd9b69175c7 (patch)
tree0b5b7f37b1c2255f0834d67c7b0e8b4a401c8203
parentb64b4629ea8aa669d652ffb32fe7a7336bd8ea8c (diff)
downloadCMake-b966f489c1b35cbc897720f1f9b68bd9b69175c7.zip
CMake-b966f489c1b35cbc897720f1f9b68bd9b69175c7.tar.gz
CMake-b966f489c1b35cbc897720f1f9b68bd9b69175c7.tar.bz2
VS: Do not use absolute paths to CUDA sources
The CUDA Toolkit's VS integration does not properly compute the intermediate files directory location when the path to the source file is absolute.
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index 613c825..c4bcd41 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -1717,8 +1717,10 @@ void cmVisualStudio10TargetGenerator::WriteSource(std::string const& tool,
//
// and fail if this exceeds the maximum allowed path length. Our path
// conversion uses full paths when possible to allow deeper trees.
- bool forceRelative = false;
- std::string sourceFile = this->ConvertPath(sf->GetFullPath(), false);
+ // However, CUDA 8.0 msbuild rules fail on absolute paths so for CUDA
+ // we must use relative paths.
+ bool forceRelative = sf->GetLanguage() == "CUDA";
+ std::string sourceFile = this->ConvertPath(sf->GetFullPath(), forceRelative);
if (this->LocalGenerator->GetVersion() ==
cmGlobalVisualStudioGenerator::VS10 &&
cmSystemTools::FileIsFullPath(sourceFile.c_str())) {