diff options
author | Brad King <brad.king@kitware.com> | 2023-03-30 13:43:01 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2023-03-30 13:43:01 (GMT) |
commit | 6546da83b33778edbcd1859c55d758caece09c5e (patch) | |
tree | 71e86ca2f9a954ffb08aaaa3c42d214c2e7f8bac | |
parent | 4901fdb201bc6264e976e105780a490d9c0eba19 (diff) | |
download | CMake-6546da83b33778edbcd1859c55d758caece09c5e.zip CMake-6546da83b33778edbcd1859c55d758caece09c5e.tar.gz CMake-6546da83b33778edbcd1859c55d758caece09c5e.tar.bz2 |
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
-rw-r--r-- | Source/cmGeneratorTarget.cxx | 4 |
1 files 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) { |