Browse Source

Merge topic 'cuda-non-device-link'

7da2c8c543 Merge branch 'backport-cuda-non-device-link'
738f3f23aa Ninja: Do not use nvcc response files with non-nvcc tools

Acked-by: Kitware Robot <[email protected]>
Acked-by: Robert Maynard <[email protected]>
Merge-request: !4376
Brad King 5 years ago
parent
commit
64ed4f6f99
2 changed files with 3 additions and 3 deletions
  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)
 set(CMAKE_CUDA_USE_RESPONSE_FILE_FOR_OBJECTS 0)
 
 
 if (CMAKE_CUDA_COMPILER_VERSION VERSION_GREATER_EQUAL "9.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 ")
   set(CMAKE_CUDA_RESPONSE_FILE_FLAG "--options-file ")
 endif()
 endif()
 
 

+ 2 - 2
Source/cmNinjaNormalTargetGenerator.cxx

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