Browse Source

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=...'
Brad King 1 year ago
parent
commit
45d53bdb70
1 changed files with 1 additions and 1 deletions
  1. 1 1
      Source/cmGeneratorTarget.cxx

+ 1 - 1
Source/cmGeneratorTarget.cxx

@@ -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;