]> git.lizzy.rs Git - rust.git/commitdiff
Ship libLLVM.dylib on OSX
authorAlex Crichton <alex@alexcrichton.com>
Fri, 7 Sep 2018 02:06:09 +0000 (19:06 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Fri, 7 Sep 2018 02:06:09 +0000 (19:06 -0700)
Previously we just weren't shipping this at all as we were only looking for the
Linux version!

src/bootstrap/dist.rs

index c3282275f6fd48969cf35df75113b5a946189f88..167e4a78edaf8e9a251d21eb7e9273c306e9c3dd 100644 (file)
@@ -1902,6 +1902,16 @@ fn maybe_install_llvm_dylib(builder: &Builder,
     let src_libdir = builder
         .llvm_out(target)
         .join("lib");
+    let dst_libdir = image.join("lib/rustlib").join(&*target).join("lib");
+    t!(fs::create_dir_all(&dst_libdir));
+
+    if target.contains("apple-darwin") {
+        let llvm_dylib_path = src_libdir.join("libLLVM.dylib");
+        if llvm_dylib_path.exists() {
+            builder.install(&llvm_dylib_path, &dst_libdir, 0o644);
+        }
+        return
+    }
 
     // Usually libLLVM.so is a symlink to something like libLLVM-6.0.so.
     // Since tools link to the latter rather than the former, we have to
@@ -1913,8 +1923,6 @@ fn maybe_install_llvm_dylib(builder: &Builder,
                    llvm_dylib_path.display(), e);
         });
 
-        let dst_libdir = image.join("lib/rustlib").join(&*target).join("lib");
-        t!(fs::create_dir_all(&dst_libdir));
 
         builder.install(&llvm_dylib_path, &dst_libdir, 0o644);
     }