summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2024-07-18 12:57:21 (GMT)
committerKitware Robot <kwrobot@kitware.com>2024-07-18 12:57:47 (GMT)
commit07c1287c87d4d2ac369d398d4444630166e39c78 (patch)
treeb8eb8a41126e1f1361e87b8d72b1cbb3e44f18ae /Source
parentd12c3e711d2ac7db52c7dc86c7434bafaa03a261 (diff)
parenta9210a0c02dd8cc1325d2cbb5eb53e29276f7d4a (diff)
downloadCMake-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.cxx8
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;
}