浏览代码

Merge branch 'backport-cuda-non-device-link'

Brad King 5 年之前
父节点
当前提交
7da2c8c543
共有 2 个文件被更改,包括 3 次插入3 次删除
  1. 1 1
      Modules/Compiler/NVIDIA-CUDA.cmake
  2. 2 2
      Source/cmNinjaNormalTargetGenerator.cxx

+ 1 - 1
Modules/Compiler/NVIDIA-CUDA.cmake

@@ -82,7 +82,7 @@ set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_LIBRARIES 0)
 set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_OBJECTS 0)
 
 if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "9.0")
-  set(CMAKE_CUDA_RESPONSE_FILE_LINK_FLAG "--options-file ")
+  set(CMAKE_CUDA_RESPONSE_FILE_DEVICE_LINK_FLAG "--options-file ")
   set(CMAKE_CUDA_RESPONSE_FILE_FLAG "--options-file ")
 endif()
 

+ 2 - 2
Source/cmNinjaNormalTargetGenerator.cxx

@@ -197,7 +197,7 @@ void cmNinjaNormalTargetGenerator::WriteDeviceLinkRule(
 
     // build response file name
     std::string responseFlag = this->GetMakefile()->GetSafeDefinition(
-      "CMAKE_CUDA_RESPONSE_FILE_LINK_FLAG");
+      "CMAKE_CUDA_RESPONSE_FILE_DEVICE_LINK_FLAG");
 
     if (!useResponseFile || responseFlag.empty()) {
       vars.Objects = "$in";
@@ -311,7 +311,7 @@ void cmNinjaNormalTargetGenerator::WriteLinkRule(bool useResponseFile,
 
     if (flag) {
       responseFlag = flag;
-    } else if (this->TargetLinkLanguage(config) != "CUDA") {
+    } else {
       responseFlag = "@";
     }