Skip to content

Commit

Permalink
Merge topic 'vs-cuda' into release-3.30
Browse files Browse the repository at this point in the history
a9210a0 VS: Restore support for CUDA with no optimization flags

Acked-by: Kitware Robot <[email protected]>
Acked-by: Robert Maynard <[email protected]>
Merge-request: !9666
  • Loading branch information
bradking authored and kwrobot committed Jul 18, 2024
2 parents d12c3e7 + a9210a0 commit 07c1287
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Source/cmVisualStudio10TargetGenerator.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3880,6 +3880,14 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions(
cudaOptions.AddFlag("CudaRuntime", "None");
}

if (this->ProjectType == VsProjectType::vcxproj && this->MSTools) {
// Suppress inheritance of host compiler optimization flags
// when the project does not specify any optimization flags for CUDA.
if (!cudaOptions.HasFlag("Optimization")) {
cudaOptions.AddFlag("Optimization", "");
}
}

this->CudaOptions[configName] = std::move(pOptions);
return true;
}
Expand Down

0 comments on commit 07c1287

Please sign in to comment.