VS/CUDA: Forward unknown flags to the host compiler when possible

Extend commit 7f15c99851 (CUDA: forward unknown flags to host compiler
when possible, 2019-11-29, v3.17.0-rc1~326^2~1) to work in VS too.

Fixes: #27210
This commit is contained in:
Brad King
2025-11-13 14:48:59 -05:00
parent 22e4e7448f
commit c185998420

View File

@@ -3872,7 +3872,8 @@ bool cmVisualStudio10TargetGenerator::ComputeCudaOptions(
auto cudaVersion = this->GlobalGenerator->GetPlatformToolsetCudaString();
// Get compile flags for CUDA in this directory.
std::string flags;
std::string flags =
this->Makefile->GetSafeDefinition("_CMAKE_CUDA_EXTRA_FLAGS");
this->LocalGenerator->AddLanguageFlags(
flags, this->GeneratorTarget, cmBuildStep::Compile, "CUDA", configName);
this->LocalGenerator->AddCompileOptions(flags, this->GeneratorTarget, "CUDA",