mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-24 11:32:44 +08:00
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.
This commit is contained in:
@@ -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())) {
|
||||
|
||||
Reference in New Issue
Block a user