From 6546da83b33778edbcd1859c55d758caece09c5e Mon Sep 17 00:00:00 2001 From: Brad King Date: Thu, 30 Mar 2023 09:43:01 -0400 Subject: CUDA: Fix CUDA architecture flags for nvcc response files `nvcc --options-file` does not parse unquoted arguments in a response file correctly if they contain `[]`. Quote the `--generate-code=` flags we add for CUDA architectures. Fixes: #24657 --- Source/cmGeneratorTarget.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx index 8a14eaf..bc5505f 100644 --- a/Source/cmGeneratorTarget.cxx +++ b/Source/cmGeneratorTarget.cxx @@ -3626,7 +3626,7 @@ void cmGeneratorTarget::AddCUDAArchitectureFlags(cmBuildStep compileOrLink, for (CudaArchitecture& architecture : architectures) { flags += - " --generate-code=arch=compute_" + architecture.name + ",code=["; + " \"--generate-code=arch=compute_" + architecture.name + ",code=["; if (architecture.virtual_) { flags += "compute_" + architecture.name; @@ -3646,7 +3646,7 @@ void cmGeneratorTarget::AddCUDAArchitectureFlags(cmBuildStep compileOrLink, flags += "sm_" + architecture.name; } - flags += "]"; + flags += "]\""; } } else if (compiler == "Clang") { for (CudaArchitecture& architecture : architectures) { -- cgit v0.12