diff options
author | Brad King <brad.king@kitware.com> | 2024-07-18 12:57:21 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2024-07-18 12:57:47 (GMT) |
commit | 07c1287c87d4d2ac369d398d4444630166e39c78 (patch) | |
tree | b8eb8a41126e1f1361e87b8d72b1cbb3e44f18ae /Source | |
parent | d12c3e711d2ac7db52c7dc86c7434bafaa03a261 (diff) | |
parent | a9210a0c02dd8cc1325d2cbb5eb53e29276f7d4a (diff) | |
download | CMake-07c1287c87d4d2ac369d398d4444630166e39c78.zip CMake-07c1287c87d4d2ac369d398d4444630166e39c78.tar.gz CMake-07c1287c87d4d2ac369d398d4444630166e39c78.tar.bz2 |
Merge topic 'vs-cuda' into release-3.30
a9210a0c02 VS: Restore support for CUDA with no optimization flags
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: Robert Maynard <robertjmaynard@gmail.com>
Merge-request: !9666
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmVisualStudio10TargetGenerator.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx index 0fb8bae..a3d5244 100644 --- a/Source/cmVisualStudio10TargetGenerator.cxx +++ b/Source/cmVisualStudio10TargetGenerator.cxx @@ -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; } |