CUDA/Clang: Do not pass explicit architecture flags when linking

Clang does not use architecture flags while driving the linker:

    warning: argument unused during compilation: '--cuda-gpu-arch=...'
This commit is contained in:
Brad King
2024-01-18 13:16:13 -05:00
parent c75047709f
commit 45d53bdb70

View File

@@ -3578,7 +3578,7 @@ void cmGeneratorTarget::AddCUDAArchitectureFlagsImpl(cmBuildStep compileOrLink,
flags += "]\"";
}
} else if (compiler == "Clang") {
} else if (compiler == "Clang" && compileOrLink == cmBuildStep::Compile) {
for (CudaArchitecture& architecture : architectures) {
flags += " --cuda-gpu-arch=sm_" + architecture.name;