浏览代码

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 年之前
父节点
当前提交
45d53bdb70
共有 1 个文件被更改,包括 1 次插入1 次删除
  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;