Selaa lähdekoodia

Merge branch 'cuda-filter-device-link-libs' into release-3.13

Merge-request: !2536
Brad King 7 vuotta sitten
vanhempi
sitoutus
f366228c80
1 muutettua tiedostoa jossa 8 lisäystä ja 8 poistoa
  1. 8 8
      Source/cmLinkLineDeviceComputer.cxx

+ 8 - 8
Source/cmLinkLineDeviceComputer.cxx

@@ -77,15 +77,15 @@ std::string cmLinkLineDeviceComputer::ComputeLinkLibraries(
 
     std::string out;
     if (item.IsPath) {
-      // nvcc understands absolute paths to libraries ending in '.a' should
-      // be passed to nvlink.  Other extensions like '.so' or '.dylib' are
-      // rejected by the nvcc front-end even though nvlink knows to ignore
-      // them.  Bypass the front-end via '-Xnvlink'.
-      if (!cmHasLiteralSuffix(item.Value, ".a")) {
-        out += "-Xnvlink ";
+      // nvcc understands absolute paths to libraries ending in '.a' or '.lib'.
+      // These should be passed to nvlink.  Other extensions need to be left
+      // out because nvlink may not understand or need them.  Even though it
+      // can tolerate '.so' or '.dylib' it cannot tolerate '.so.1'.
+      if (cmHasLiteralSuffix(item.Value, ".a") ||
+          cmHasLiteralSuffix(item.Value, ".lib")) {
+        out += this->ConvertToOutputFormat(
+          this->ConvertToLinkReference(item.Value));
       }
-      out +=
-        this->ConvertToOutputFormat(this->ConvertToLinkReference(item.Value));
     } else if (cmLinkItemValidForDevice(item.Value)) {
       out += item.Value;
     }