mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-06 05:40:54 -06:00
VS: Drop workaround for CUDA compiler PDB location on CUDA 9.2+
The workaround added by commit v3.12.0-rc1~227^2 (VS: Add workaround for CUDA compiler PDB location, 2018-04-13) is not necessary on CUDA 9.2+ because the CUDA Toolkit Visual Studio Integration has fixed the original bug and forwards the `ProgramDataBaseFileName` to the host compiler itself. Make the workaround conditional on the CUDA version. Issue: #18440
This commit is contained in:
@@ -2811,15 +2811,19 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions(
|
||||
// Specify the compiler program database file if configured.
|
||||
std::string pdb = this->GeneratorTarget->GetCompilePDBPath(configName);
|
||||
if (!pdb.empty()) {
|
||||
// CUDA does not have a field for this and does not honor the
|
||||
// ProgramDataBaseFileName field in ClCompile. Work around this
|
||||
// limitation by creating the directory and passing the flag ourselves.
|
||||
// CUDA does not make the directory if it is non-standard.
|
||||
std::string const pdbDir = cmSystemTools::GetFilenamePath(pdb);
|
||||
cmSystemTools::MakeDirectory(pdbDir);
|
||||
pdb = this->ConvertPath(pdb, true);
|
||||
ConvertToWindowsSlash(pdb);
|
||||
std::string const clFd = "-Xcompiler=\"-Fd\\\"" + pdb + "\\\"\"";
|
||||
cudaOptions.AppendFlagString("AdditionalOptions", clFd);
|
||||
if (cmSystemTools::VersionCompareGreaterEq(
|
||||
"9.2", this->GlobalGenerator->GetPlatformToolsetCudaString())) {
|
||||
// CUDA does not have a field for this and does not honor the
|
||||
// ProgramDataBaseFileName field in ClCompile. Work around this
|
||||
// limitation by creating the directory and passing the flag ourselves.
|
||||
pdb = this->ConvertPath(pdb, true);
|
||||
ConvertToWindowsSlash(pdb);
|
||||
std::string const clFd = "-Xcompiler=\"-Fd\\\"" + pdb + "\\\"\"";
|
||||
cudaOptions.AppendFlagString("AdditionalOptions", clFd);
|
||||
}
|
||||
}
|
||||
|
||||
// CUDA automatically passes the proper '--machine' flag to nvcc
|
||||
|
||||
Reference in New Issue
Block a user